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 35
35
echo " Git status is clean. Proceeding with the script." ;
36
36
fi
37
37
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
+
38
49
# Run your commands
39
50
# Run changeset version command and capture its output
40
51
echo " Running: pnpm exec changeset version --snapshot $version "
48
59
exit 1
49
60
fi
50
61
62
+ read -e -p " Pausing for manual changes, press Enter when ready to continue..."
63
+
51
64
echo " Running: pnpm run clean --filter \" @trigger.dev/*\" --filter \" trigger.dev\" "
52
65
pnpm run clean --filter " @trigger.dev/*" --filter " trigger.dev"
53
66
@@ -59,11 +72,9 @@ read -p "Do you wish to continue? (y/N): " prompt
59
72
if [[ $prompt =~ [yY](es)* ]]; then
60
73
pnpm exec changeset publish --no-git-tag --snapshot --tag $version
61
74
else
62
- echo " Publish command aborted by the user."
63
- git reset --hard HEAD
64
- exit 1;
75
+ abort
65
76
fi
66
77
67
78
# If there were no errors, clear the git stage
68
79
echo " 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