Browse Source

make build script smarter

Adam Shaw 9 năm trước cách đây
mục cha
commit
bd33776890
2 tập tin đã thay đổi với 4 bổ sung7 xóa
  1. 2 5
      bin/build-release.sh
  2. 2 2
      bin/publish-release.sh

+ 2 - 5
bin/build-release.sh

@@ -47,7 +47,7 @@ then
 	git checkout -- *.json
 else
 	# save reference to current branch
-	orig_ref=$(git symbolic-ref --quiet HEAD)
+	current_branch=$(git symbolic-ref --quiet --short HEAD)
 
 	# make a tagged detached commit of the dist files.
 	# no-verify (-n) avoids commit hooks.
@@ -63,10 +63,7 @@ else
 	fi
 
 	# return to branch
-	git symbolic-ref HEAD "$orig_ref"
-
-	# unstage ignored generated files or files leftover from failed git add's
-	git reset
+	git checkout --quiet "$current_branch"
 fi
 
 if [[ "$success" = "1" ]]

+ 2 - 2
bin/publish-release.sh

@@ -19,11 +19,11 @@ fi
 git push
 git push origin "v$version"
 
+success=0
+
 # save reference to current branch
 current_branch=$(git symbolic-ref --quiet --short HEAD)
 
-success=0
-
 # temporarily checkout the tag's commit, publish to NPM
 git checkout --quiet "v$version"
 if npm publish