NPM - Run Custom Bash Script with Arguments

### package.json : ' { "name": "angular-seed", "private": true, "version": "0.0.0", "description": "A starter project for AngularJS", "repository": "https://github.com/angular/angular-seed", "license": "MIT", "devDependencies": { }, "scripts": { "custom-bash": "./bin/bash.sh" } } ' ### bin/bash.sh ### Note: Be sure to `sudo chmod +x ./bin/bash.sh` #!/bin/bash set -o errexit # Exit on error echo "Arguments passed to bash.sh: $@"; ### Execute NPM Script from terminal npm run custom-bash --- 1 2 3 --test abc : ' Output: Arguments passed to bash.sh 1 2 3 --test abc '

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.