I'm using Parallels because I prefer the Mac OS but the work we do is all in Visual Studio. We currently have a build.cmd batch file that builds our typescript files. Because I'd prefer to work on the Mac side when I can, I thought I would rewrite the script in bash and to also get some experience writing a shell script. I have a main build.sh command that runs the other shell scripts like compile-templates.sh and compile-source.sh. I am trouble with the compile-source.sh portion now. Currently, the batch file looks like:
echo TypeScript Version:
CALL node_modules\.bin\tsc -v
The typescript compiler is included in our Solution so we are all using the same one throughout the solution. In my compile-source.sh, I try to do this:
node_modules/.bin/tsc -v
or this
./node_modules/.bin/tsc -v
And I get permission denied. Is there something I'm doing wrong?
There are several approaches to try. You can use bash to run the script like this:
bash node_modules/.bin/tsc -v
Or you can try to change the permissions on the file:
chmod a+x node_modules/.bin/tsc
This should enable you to run the script like this:
./node_modules/.bin/tsc -v
But in that case, make sure your script starts with a shebang line to tell the system it is a bash script:
#!/usr/bin/env bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With