Kaynağa Gözat

Make it so that bash scripts fail on the first fail

And add other handy/polite sugar such as easy traces and pointers to
current file
Kevin van Zonneveld 9 yıl önce
ebeveyn
işleme
c65552b455
4 değiştirilmiş dosya ile 37 ekleme ve 0 silme
  1. 9 0
      bin/build-css
  2. 9 0
      bin/build-umd
  3. 9 0
      bin/test
  4. 10 0
      bin/web-deploy

+ 9 - 0
bin/build-css

@@ -1,3 +1,12 @@
 #!/usr/bin/env bash
+set -o pipefail
+set -o errexit
+set -o nounset
+# set -o xtrace
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
 
 node_modules/.bin/node-sass src/scss/index.scss -o dist/uppy.css

+ 9 - 0
bin/build-umd

@@ -1,4 +1,13 @@
 #!/usr/bin/env bash
+set -o pipefail
+set -o errexit
+set -o nounset
+# set -o xtrace
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
 
 SRC="src/index.js"
 OUT="uppy.js"

+ 9 - 0
bin/test

@@ -1,4 +1,13 @@
 #!/usr/bin/env bash
+set -o pipefail
+set -o errexit
+set -o nounset
+# set -o xtrace
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
 
 # Move into a known directory
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

+ 10 - 0
bin/web-deploy

@@ -1,4 +1,14 @@
 #!/usr/bin/env bash
+set -o pipefail
+set -o errexit
+set -o nounset
+# set -o xtrace
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
+
 ghpages_repo=${GHPAGES_REPO:-"transloadit/uppy"}
 ghpages_branch=${GHPAGES_BRANCH:-"gh-pages"}
 ghpages_url=${GHPAGES_URL:-"git@github.com:${ghpages_repo}.git"}