question

IgorKoltun-8429 avatar image
0 Votes"
IgorKoltun-8429 asked IgorKoltun-8429 answered

Can't create shell script with CD and execute command

I am trying to create automatic running scripts for developers on Windows(execute one command ./update instead running 5-6 commands in different folders)
CLI is Powershell (Windows Terminal on Windows 10 Pro)

Example command for linux that works on linux machine:
cd $PWD/angular && npm install
cd $PWD/angular && ng build
cd $PWD/react && npm install
cd $PWD/react && ng build

Example command for Windows that wont work:
cd $PWD/angular && npm install
cd $PWD/angular | npm install
cd angular && npm install

Getting an error "The system cannot find the path specified."

Please don't recommend me use WSL2 and other due to this is not my resolving.

windows-server
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

Does the specified path exist? You can check it by running Test-Path $PWD/angular and see if "True" is returned.

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IgorKoltun-8429 avatar image
0 Votes"
IgorKoltun-8429 answered

PS C:\Server\apps\study-space> Test-Path $PWD/backend/client-apps
True

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.