I am a complete newbie to linux and CSH Scripts, I am currently working on a UI Project with reactjs + node + npm + webpack.
As you may now, i need to run webpack bundling to get complied files.
My project is being deployed on a linux machine.
This is my project structure as shown below,
I need to write a csh script in uibuild.csh file as show above,
So this is what i think pseudocode would be,
The script will be executed from
'npm run build'
if(`where node` == "") then
printf "\nNode.js and Npm not installed. Please install and continue\n";
if which node > /dev/null ; then printf 'Node.js & NPM installed, continue start builing.. \n' else printf '\x1B[31m Node.js & NPM is not installed, exiting now.. \x1B[0m \n' exit 0; fi printf 'Current working Directory :: ' pwd cd ../../uisrc/ printf 'Current working Directory :: ' pwd cd dist/ rm -rf index.html assets fixtures cd .. npm install --verbose npm run build cd .. rm -rf index.html assets fixtures cd uisrc/ mv dist/* ../