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

Run shell functions #46

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Run shell functions #46

wants to merge 5 commits into from

Conversation

j4mie
Copy link
Member

@j4mie j4mie commented Sep 17, 2020

Before:

$ crab nvm
Could not find "nvm" in your procfile or $PATH.

After:

$ crab nvm

Node Version Manager (v0.35.3)
...

# off we go
os.execvpe(command[0], command, env)
# Is it a shell function?
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should follow the semantics of shell functions in that they override items in the $PATH, rather than only being called if they don't exist.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, so swap the two checks?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed


# off we go
os.execvpe(command[0], command, env)
print('Could not find "{}" in your procfile or $PATH.'.format(command[0]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth mentioning here about it also not being a shell function?

Although that would be quite a long message. Shells just do "command not found".

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

Successfully merging this pull request may close these issues.

2 participants