Skip to content

Commit aa3e57d

Browse files
committed
add pause to prerelease script for any manual edits
1 parent 0198077 commit aa3e57d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

scripts/publish-prerelease.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ else
3535
echo "Git status is clean. Proceeding with the script.";
3636
fi
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
4051
echo "Running: pnpm exec changeset version --snapshot $version"
@@ -48,6 +59,8 @@ else
4859
exit 1
4960
fi
5061

62+
read -e -p "Pausing for manual changes, press Enter when ready to continue..."
63+
5164
echo "Running: pnpm run clean --filter \"@trigger.dev/*\" --filter \"trigger.dev\""
5265
pnpm run clean --filter "@trigger.dev/*" --filter "trigger.dev"
5366

@@ -59,11 +72,9 @@ read -p "Do you wish to continue? (y/N): " prompt
5972
if [[ $prompt =~ [yY](es)* ]]; then
6073
pnpm exec changeset publish --no-git-tag --snapshot --tag $version
6174
else
62-
echo "Publish command aborted by the user."
63-
git reset --hard HEAD
64-
exit 1;
75+
abort
6576
fi
6677

6778
# If there were no errors, clear the git stage
6879
echo "Commands ran successfully. Clearing the git stage."
69-
git reset --hard HEAD
80+
git_reset

0 commit comments

Comments
 (0)