Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shelly can't run command with a relative path anymore #107

Closed
gdetrez opened this issue Jul 29, 2015 · 5 comments · Fixed by #216
Closed

Shelly can't run command with a relative path anymore #107

gdetrez opened this issue Jul 29, 2015 · 5 comments · Fixed by #216
Labels
path Issues with the system PATH
Milestone

Comments

@gdetrez
Copy link

gdetrez commented Jul 29, 2015

Using cmd or run with a relative path doesn't work anymore (it used to some version ago).
E.g.

shelly (cmd "./foo")
@gregwebs
Copy link
Owner

Thanks for opening the bug. Not sure what changed to mess this up. I uploaded version 1.6.3.2

@gdetrez
Copy link
Author

gdetrez commented Jul 29, 2015

The new version doesn't seem to fix the problem. I still got an exception when trying to run a command with a relative path:

*Main Shelly> shelly $ cmd "./foo"
*** Exception: 
Ran commands: 
./foo
which ./foo

Exception: user error (shelly did not find ./foo in the PATH: ...)

*Main Shelly> shelly $ canonicalize "./foo" >>= cmd
Hello World
"Hello World\n"

@gregwebs gregwebs reopened this Jul 30, 2015
@gdetrez
Copy link
Author

gdetrez commented Jul 30, 2015

It seems to be system dependent as it works on OS X (10.8.5) but not on fedora (22). (And since I didn't get the problem before, I suspect it worked on fedora 20 as well.)

I don't quite understand what is causing this but I found a subtle difference that might be relevant: when I try to run a command that does not exist, the error message is slightly different:

OS X

Shelly> shelly $ verbosely $ cmd "./fooo"
./fooo
*** Exception: 
Ran commands: 
echo './fooo'
./fooo
which ./fooo

Exception: error running: ./fooo
exit status: 127. exit code 127 usually means the command does not exist (in the PATH)
stderr: 

Fedora

Shelly> shelly $ verbosely $ cmd "./fooo"
./fooo
*** Exception: 
Ran commands: 
echo './fooo'
./fooo
which ./fooo

Exception: user error (shelly did not find ./fooo in the PATH: /home/gregoire/tmp/.cabal-sandbox/bin:/home/gregoire/.cabal/bin:/usr/local/bin:/usr/local/sbin:/usr/lib64/qt-3.3/bin:/usr/bin:/usr/sbin:/bin:/sbin:/home/gregoire/bin:/home/gregoire/.local/bin)

@gregwebs
Copy link
Owner

I don't think this should behave different on different OSs. Are you using the latest version of shelly on Fedora?

:set -package shelly-1.6.3.2

@gdetrez
Copy link
Author

gdetrez commented Jul 30, 2015

I think so:

Prelude Shelly> :set -package shelly-1.6.3.2
package flags have changed, resetting and loading new packages...
Prelude Shelly> import Shelly
Prelude Shelly> shelly $ cmd "./fooo"
*** Exception: 
Ran commands: 
./fooo
which ./fooo

Exception: user error (shelly did not find ./fooo in the PATH: ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
path Issues with the system PATH
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants