When trying to run the bats program I get a
-bash: bats: command not found error.
Any ideas what I need to do to resolve. I installed bats as per the instructions. See attached image for results of that.
When trying to run the bats program I get a
-bash: bats: command not found error.
Any ideas what I need to do to resolve. I installed bats as per the instructions. See attached image for results of that.
Is /home/Colin/bin
in your $PATH?
Is /home/Colin/bin/bats
executable?
No.
Yes.
After adding the directory to my PATH and running:
bats raindrops.bats
/home/Colin/bin/bats: line 2: $‘\r’: command not found
: invalid option name line 3: set: pipefail
\r
is a carriage return which should not exist in that file and is often the result of a copy/paste or running a file intended for Windows.
On a Mac, I’d recommend installing both bash and bats with Homebrew.
To fix bats: sed -i '' 's/\r$//' ~/bin/bats
In the testing on the Bash track section I followed the instructions:
For Windows (MINGW64/Cygwin)
$ git clone https://github.com/bats-core/bats-core.git
$ cd bats-core
$ ./install.sh $HOME```
Does no further comments or questions from Isaac or Glenn mean no further suggestions as to how to resolve the problem I have with running the bash testing locally (other than to update my system) ?
Or can I supply any other information that may help?
If yes to first and no to second let me know and I will persist with making submissions with the Editor instead even if it is not my preferred option.
In my case I have an old Lenovo Thinkpad Edge with Windows 7 and Cygwin installed. bats is not a package available in Cygwin so I just followed the Exercism instructions with the git clone…
Had this problem too, but fixed it. On Mac:
→ edits. - don’t super know what I am doing
~/.bash_profile
if you have no ~/.bashrc
. ->not sure this matters, didn’t affect anythingsource ~/.bash_profile
, → not sure to do this, further test showed works withoutsource ~/.bash_profile
from a vscode window but from a normal terminal window. → half right, actually just download the track exercise from a terminal window not vscode terminal windowexercism:2: command not found: readarray
error, that seems not to matter. → probably not correct if the ‘wrapper function’ function is important on mac, tried seems notLikely to edit this again.
Thanks for sharing!
Should we be adding this to the track docs somewhere? (Probably a question more to maintainers)