Procházet zdrojové kódy

bin scripts 2 spaces

Adam Shaw před 8 roky
rodič
revize
ccd53eef5d

+ 41 - 41
bin/build-release.sh

@@ -11,72 +11,72 @@ cd "`dirname $0`/.."
 read -p "Have you already updated the changelog? (y/N): " updated_changelog
 if [[ "$updated_changelog" != "y" ]]
 then
-	echo "Go do that!"
-	exit 1
+  echo "Go do that!"
+  exit 1
 fi
 
 read -p "Would you like to update dates in the demos? (y/N): " update_demos
 if [[ "$update_demos" == "y" ]]
 then
-	./bin/update-demo-dates.sh
+  ./bin/update-demo-dates.sh
 fi
 
 read -p "Enter the new version number with no 'v' (for example '1.0.1'): " version
 if [[ ! "$version" ]]
 then
-	echo "Aborting."
-	exit 1
+  echo "Aborting."
+  exit 1
 fi
 
 success=0
 if {
-	# make sure deps are as new as possible for bundle
-	npm update &&
+  # make sure deps are as new as possible for bundle
+  npm update &&
 
-	# ensures stray files stay out of the release
-	gulp clean &&
+  # ensures stray files stay out of the release
+  gulp clean &&
 
-	# update package manager json files with version number and release date
-	gulp bump --version=$version &&
+  # update package manager json files with version number and release date
+  gulp bump --version=$version &&
 
-	# build all dist files, lint, and run tests
-	gulp release
+  # build all dist files, lint, and run tests
+  gulp release
 }
 then
-	# save reference to current branch
-	current_branch=$(git symbolic-ref --quiet --short HEAD)
-
-	# make a tagged detached commit of the dist files.
-	# no-verify avoids commit hooks.
-	if {
-		git checkout --quiet --detach &&
-		git add *.json &&
-		git add -f dist/*.js dist/*.css dist/locale/*.js &&
-		git commit --quiet --no-verify -e -m "version $version" &&
-		git tag -a "v$version" -m "version $version"
-	}
-	then
-		success=1
-	fi
-
-	# return to branch
-	git checkout --quiet "$current_branch"
+  # save reference to current branch
+  current_branch=$(git symbolic-ref --quiet --short HEAD)
+
+  # make a tagged detached commit of the dist files.
+  # no-verify avoids commit hooks.
+  if {
+    git checkout --quiet --detach &&
+    git add *.json &&
+    git add -f dist/*.js dist/*.css dist/locale/*.js &&
+    git commit --quiet --no-verify -e -m "version $version" &&
+    git tag -a "v$version" -m "version $version"
+  }
+  then
+    success=1
+  fi
+
+  # return to branch
+  git checkout --quiet "$current_branch"
 fi
 
 if [[ "$success" == "1" ]]
 then
-	# keep newly generated dist files around
-	git checkout --quiet "v$version" -- dist
-	git reset --quiet -- dist
+  # keep newly generated dist files around
+  git checkout --quiet "v$version" -- dist
+  git reset --quiet -- dist
 
-	echo "Success."
+  echo "Success."
 else
-	# unstage all dist/ or *.json changes
-	git reset --quiet
+  # unstage all dist/ or *.json changes
+  git reset --quiet
 
-	# discard changes from version bump
-	git checkout --quiet -- *.json
+  # discard changes from version bump
+  git checkout --quiet -- *.json
 
-	echo "Failure."
-	exit 1
+  echo "Failure."
+  exit 1
 fi

+ 7 - 7
bin/publish-release.sh

@@ -11,8 +11,8 @@ cd "`dirname $0`/.."
 read -p "Enter the version you want to publish, with no 'v' (for example '1.0.1'): " version
 if [[ ! "$version" ]]
 then
-	echo "Aborting."
-	exit 1
+  echo "Aborting."
+  exit 1
 fi
 
 # push the current branch (assumes tracking is set up) and the tag
@@ -28,7 +28,7 @@ current_branch=$(git symbolic-ref --quiet --short HEAD)
 git checkout --quiet "v$version"
 if npm publish
 then
-	success=1
+  success=1
 fi
 
 # return to branch
@@ -40,9 +40,9 @@ git reset --quiet -- dist
 
 if [[ "$success" == "1" ]]
 then
-	./bin/verify-npm.sh
-	echo "Success."
+  ./bin/verify-npm.sh
+  echo "Success."
 else
-	echo "Failure."
-	exit 1
+  echo "Failure."
+  exit 1
 fi

+ 9 - 9
bin/require-clean-working-tree.sh

@@ -8,7 +8,7 @@ working_subdir="$1"
 # git complains if empty string path in statements below
 if [[ -z "$working_subdir" ]]
 then
-	working_subdir="."
+  working_subdir="."
 fi
 
 # Update the index
@@ -18,21 +18,21 @@ err=0
 # Disallow unstaged changes in the working tree
 if ! git diff-files --quiet --ignore-submodules -- "$working_subdir"
 then
-	echo >&2 "You have unstaged changes."
-	git diff-files --name-status -r --ignore-submodules -- "$working_subdir" >&2
-	err=1
+  echo >&2 "You have unstaged changes."
+  git diff-files --name-status -r --ignore-submodules -- "$working_subdir" >&2
+  err=1
 fi
 
 # Disallow uncommitted changes in the index
 if ! git diff-index --cached --quiet HEAD --ignore-submodules --
 then
-	echo >&2 "Your index contains uncommitted changes."
-	git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
-	err=1
+  echo >&2 "Your index contains uncommitted changes."
+  git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2
+  err=1
 fi
 
 if [ $err = 1 ]
 then
-	echo >&2 "Please commit or stash them."
-	exit 1
+  echo >&2 "Please commit or stash them."
+  exit 1
 fi

+ 2 - 2
bin/update-demo-dates.sh

@@ -16,8 +16,8 @@ read -p "Is that ok? (y/N): " yn
 
 if [[ "$yn" != "y" ]]
 then
-	echo "Aborting."
-	exit 1
+  echo "Aborting."
+  exit 1
 fi
 
 find demos -type f \( -name '*.html' -o -name '*.json' \) -print0 \

+ 0 - 0
bin/verify-npm.sh