Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Alias in .bashrc not working in Procfiles #41

Closed
giacomocerquone opened this issue Oct 31, 2017 · 4 comments
Closed

Alias in .bashrc not working in Procfiles #41

giacomocerquone opened this issue Oct 31, 2017 · 4 comments

Comments

@giacomocerquone
Copy link

Hi, I opened this issue also on node-foreman.
First of all thanks for you work! I've spent so much time trying to solve this problem that I don't know anymore where to ask.
The problem is simple:

I have this alias in my .bashrc file:
alias python=python3
and I'm using node-foremon in the heroku cli environment with this procfile:
worker: python botcore.py.

When I try to launch that 'worker' it goes to take python2.7 (the default python) so the alias is not working (if I give python in the shell I obviously get python 3). This is due probably to the fact that aliases don't work in non interactive shells.

How can I solve this dilemma?

@giacomocerquone giacomocerquone changed the title Alias in .bashrc not working to Alias in .bashrc not working in Procfiles Alias in .bashrc not working in Procfiles Oct 31, 2017
@jdx
Copy link
Contributor

jdx commented Oct 31, 2017

aliases won't be used by heroku local because it's not using bash, it's just executing whatever is on your PATH and aliases are not on the PATH. Here is what I would do:

First, add ./bin to your path with export PATH=./bin:$PATH in your bashrc
Next, symlink python to python3 in the root of the project: ln -s $(which python3) ./bin/python

Now if you run heroku local:run python --version you should see v3

@jdx
Copy link
Contributor

jdx commented Oct 31, 2017

closing since this is not an issue with heroku local

@jdx jdx closed this as completed Oct 31, 2017
@giacomocerquone
Copy link
Author

@jdxcode thank you very much for the support, the point is that linking from python3 to python is considered always a bad idea since it could cause lots of troubles to the os. Is this the only way?

@jdx
Copy link
Contributor

jdx commented Oct 31, 2017

my solution keeps it local to your project only so it won't mess with anything in the system

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