File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 3535 echo " Git status is clean. Proceeding with the script." ;
3636fi
3737
38+ # From here on, if the user aborts the script, we will clean up the git stage
39+ git_reset () {
40+ git reset --hard HEAD
41+ }
42+ abort () {
43+ echo " Aborted. Cleaning up..."
44+ git_reset
45+ exit 1
46+ }
47+ trap abort INT
48+
3849# Run your commands
3950# Run changeset version command and capture its output
4051echo " Running: pnpm exec changeset version --snapshot $version "
4859 exit 1
4960fi
5061
62+ read -e -p " Pausing for manual changes, press Enter when ready to continue..."
63+
5164echo " Running: pnpm run clean --filter \" @trigger.dev/*\" --filter \" trigger.dev\" "
5265pnpm run clean --filter " @trigger.dev/*" --filter " trigger.dev"
5366
@@ -59,11 +72,9 @@ read -p "Do you wish to continue? (y/N): " prompt
5972if [[ $prompt =~ [yY](es)* ]]; then
6073 pnpm exec changeset publish --no-git-tag --snapshot --tag $version
6174else
62- echo " Publish command aborted by the user."
63- git reset --hard HEAD
64- exit 1;
75+ abort
6576fi
6677
6778# If there were no errors, clear the git stage
6879echo " Commands ran successfully. Clearing the git stage."
69- git reset --hard HEAD
80+ git_reset
You can’t perform that action at this time.
0 commit comments