Skip to content

Commit 99add52

Browse files
committed
ensure a fresh yarn install before release
1 parent 6e7e778 commit 99add52

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,29 @@ info() {
99
echo "$(date '+[%Y-%m-%d %H:%M:%S]') ${PROG}: INFO: $*"
1010
}
1111

12-
# Prints an error to stderr, and exits.
1312
error() {
1413
echo "$(date '+[%Y-%m-%d %H:%M:%S]') ${PROG} ERROR: $*" >&2
1514
exit 1
1615
}
1716

17+
check_uncommitted_changes() {
18+
if ! git diff-index --quiet HEAD --; then
19+
error "There are uncommitted changes in the working directory."
20+
fi
21+
}
22+
1823
main() {
1924
local current_version
2025
current_version=$(cat package.json | jq -r .version)
21-
info "releasing ${current_version}"
26+
info "Releasing ${current_version}"
27+
2228
yarn version --new-version "${current_version}"
2329
yarn clean
30+
yarn install
31+
check_uncommitted_changes
2432
yarn dist
2533
local next_version
26-
info "release version: ${current_version}, next version:"
34+
info "Release version: ${current_version}, next version:"
2735
read next_version
2836
yarn version --no-git-tag-version --new-version "${next_version}"
2937
git add package.json

0 commit comments

Comments
 (0)