I am using a github codespace to test a discord.js bot. In it i use the command fortune | cowsay
which uses the fortune
and cowsay
commands, the fortune command is installed with sudo apt install fortune-mod
and cowsay with sudo apt install cowsay
. Their install directory is under "/usr/games" and not "/bin" therefore when I run the command fortune | cowsay
I get
bash: fortune: command not found
bash: cowsay: command not found
This is because in Github codespaces /usr/games is not in the $PATH
When I added "/usr/games" to the path in both "/etc/profile" and "~/.profile" using
export PATH="/usr/games:$PATH"
put at the bottom of both the files and then used the command "source /etc/profile" and in later testing "source ~/.profile" The commands work... but it is when I try to run the file using VScode's built in runner (hitting f5 and clicking on node.js) where it automatically makes a new shell and uses node to run the file it commands not found.
I am wondering how GitHub codespaces makes their new shells without the new path I added. And how I might be able to add the /usr/games
directory to the path for the new shell that opens when vscode runs the file