Browse Source

Use exit code.

Herby Vojčík 4 years ago
parent
commit
7d9e692c2c
1 changed files with 3 additions and 7 deletions
  1. 3 7
      check-some-are-unignored.sh

+ 3 - 7
check-some-are-unignored.sh

@@ -1,15 +1,11 @@
 #!/bin/sh
 set -e -x
 
-if [ -n "$PLUGIN_IGNORE" -a \( -n "$PLUGIN_POSITIVE" -o -n "$PLUGIN_NEGATIVE" \) ]; then
-  set "$PLUGIN_IGNORE" "$PLUGIN_POSITIVE" "$PLUGIN_NEGATIVE"
-fi
-
 PATHS="`IFS='
 ' paste -s -d:`"
 
-if [ -z "$PATHS" ] || [ -z "`node --eval "console.log(require('ignore')().add(process.argv[1].split(',')).filter(process.argv[2].split(':')).join())" "$1" "$PATHS"`" ]; then
-  if [ -n "$3" ]; then touch "$3"; fi
-else
+if [ -n "$PATHS" ] && node --eval "process.exit(require('ignore')().add(process.argv[1].split(',')).filter(process.argv[2].split(':')).length ? 0 : 1)" "$1" "$PATHS"; then
   if [ -n "$2" ]; then touch "$2"; fi
+else
+  if [ -n "$3" ]; then touch "$3"; fi
 fi