From 2cd7f3de6e0d8950d0a75c4fae51adb3d7cf9007 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Tue, 1 Nov 2016 20:30:28 +0100 Subject: [PATCH] Make paths in bin absolute --- bin/build | 7 +++++-- bin/clean | 7 +++++-- bin/lint | 9 ++++++--- bin/start | 7 +++++-- bin/test | 7 +++++-- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/bin/build b/bin/build index 2206fc00d..ae3aca8d9 100755 --- a/bin/build +++ b/bin/build @@ -20,12 +20,15 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +# Resolve root directory +ROOT=$(dirname $0)/.. + # Check if "npm install" was executed -if [[ ! -d $(pwd)/node_modules ]]; then +if [[ ! -d $ROOT/node_modules ]]; then echo "\"node_modules\" not found:" echo "npm install" exit 1 fi # Run command -$(pwd)/node_modules/.bin/gulp build --clean --optimize --revision +$ROOT/node_modules/.bin/gulp build --clean --optimize --revision diff --git a/bin/clean b/bin/clean index 3b64578fb..625e98019 100755 --- a/bin/clean +++ b/bin/clean @@ -20,12 +20,15 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +# Resolve root directory +ROOT=$(dirname $0)/.. + # Check if "npm install" was executed -if [[ ! -d $(pwd)/node_modules ]]; then +if [[ ! -d $ROOT/node_modules ]]; then echo "\"node_modules\" not found:" echo "npm install" exit 1 fi # Run command -$(pwd)/node_modules/.bin/gulp clean +$ROOT/node_modules/.bin/gulp clean diff --git a/bin/lint b/bin/lint index 9b114fce9..47ef8319b 100755 --- a/bin/lint +++ b/bin/lint @@ -20,19 +20,22 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +# Resolve root directory +ROOT=$(dirname $0)/.. + # Check if "npm install" was executed -if [[ ! -d $(pwd)/node_modules ]]; then +if [[ ! -d $ROOT/node_modules ]]; then echo "\"node_modules\" not found:" echo "npm install" exit 1 fi # Run ESLint -$(pwd)/node_modules/.bin/eslint . +$ROOT/node_modules/.bin/eslint . ESLINT=$? # Run Sass-Lint -$(pwd)/node_modules/.bin/sass-lint -c .sass-lint.yml -vq +$ROOT/node_modules/.bin/sass-lint -c .sass-lint.yml -vq SASSLINT=$? # If one command failed, exit with error diff --git a/bin/start b/bin/start index f4dae067b..e3a61d973 100755 --- a/bin/start +++ b/bin/start @@ -20,12 +20,15 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +# Resolve root directory +ROOT=$(dirname $0)/.. + # Check if "npm install" was executed -if [[ ! -d $(pwd)/node_modules ]]; then +if [[ ! -d $ROOT/node_modules ]]; then echo "\"node_modules\" not found:" echo "npm install" exit 1 fi # Run command -$(pwd)/node_modules/.bin/gulp watch --no-lint +$ROOT/node_modules/.bin/gulp watch --no-lint diff --git a/bin/test b/bin/test index 867f9fb29..279b36200 100755 --- a/bin/test +++ b/bin/test @@ -20,12 +20,15 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +# Resolve root directory +ROOT=$(dirname $0)/.. + # Check if "npm install" was executed -if [[ ! -d $(pwd)/node_modules ]]; then +if [[ ! -d $ROOT/node_modules ]]; then echo "\"node_modules\" not found:" echo "npm install" exit 1 fi # Run command -$(pwd)/node_modules/.bin/gulp test +$ROOT/node_modules/.bin/gulp test