Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Slamhound only works from the root directory #60

Open
phillord opened this issue Dec 2, 2013 · 1 comment
Open

Slamhound only works from the root directory #60

phillord opened this issue Dec 2, 2013 · 1 comment

Comments

@phillord
Copy link

phillord commented Dec 2, 2013

Slamhound only seems to work from the root directory of a project with a fully qualified file name. So consider this example:

~/scratch $ lein new slamhound-test
Generating a project called slamhound-test based on the 'default' template.  
To see other templates (app, lein plugin, etc), try `lein help new`.
~/scratch $ cd slamhound-test/src/slamhound_test/
~/scratch/slamhound-test/src/slamhound_test $ ls
core.clj
~/scratch/slamhound-test/src/slamhound_test $ lein slamhound core.clj
~/scratch/slamhound-test/src/slamhound_test $ cd ..
~/scratch/slamhound-test/src $ cd ..
~/scratch/slamhound-test $ lein slamhound src/slamhound_test/core.clj

The first use of slamhound does nothing at all (although it appears to exit normally). I think that it should either update the ns form, and at least crash when used like so.

@technomancy
Copy link
Owner

This is due to Leiningen changing directories to the project root before launching project code. However, it sets the leiningien.original.pwd property to the original directory, so we should look for relative path names based on that property if it's present.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants