瀏覽代碼

Use exit code.

Herby Vojčík 4 年之前
父節點
當前提交
7d9e692c2c
共有 1 個文件被更改,包括 3 次插入7 次删除
  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