I am trying to use a script to add a folder with automation scripts to the replit path variable. Once the script ends the path variable is unchanged. I’ve read this is because it isn’t updated in bashrc.
I can’t edit bashrc. on replit. How can I update the global path variable on replit and make it stick by using a script?
Welcome to Ask! I’m not sure this is possible. I was able to edit
nano, but the changes I made were not reflected so .
So, I do know a bit about what you’re talking about. By using a script to install scripts to the
$PATH, you are doing the right thing for now, but it will not save once the Repl is reset. Instead, try this:
- Make it install to a directory that is saved (
- Try editing the PATH variable using
[env] in .replit, sorta like this (i am not great with editing the .replit file, look it up in the docs)
PATH = "$PATH:~/projectname/myfolder/bin"
It should be able to access it now. If the files need to load libraries, set
It’s the only idea I have, sorry if it doesn’t work.
You can edit it in SECRETS and that works for me.
In bash I echo $PATH:$PWD/folder
Copy this and then make a new secret named PATH and paste this echo there. Reload the shell and your $PATH will be updated and remain when you close and reopen the repl.
~/shell$ echo $PATH:$PWD/folder