2022-04-23 02:14:40 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
2022-04-25 21:38:08 +02:00
|
|
|
# expect this to run as NPM script
|
|
|
|
: "${npm_package_version?}"
|
2022-04-25 19:10:03 +02:00
|
|
|
|
2022-04-25 18:54:58 +02:00
|
|
|
should_color=
|
2022-04-25 19:10:03 +02:00
|
|
|
if [ -t 2 ]; then # if we're sending to a terminal
|
2022-04-25 18:54:58 +02:00
|
|
|
should_color=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
reset=
|
|
|
|
bold=
|
|
|
|
if [ -n "${should_color}" ]; then
|
|
|
|
reset=$'\033'[0m
|
|
|
|
bold=$'\033'[1m
|
|
|
|
fi
|
|
|
|
|
2022-04-23 02:14:40 +02:00
|
|
|
echo >&2 "\
|
2022-04-25 18:54:58 +02:00
|
|
|
Version updated: ${bold}${npm_package_version}${reset}
|
2022-04-23 02:14:40 +02:00
|
|
|
|
|
|
|
Next steps:
|
|
|
|
|
2022-04-25 18:54:58 +02:00
|
|
|
\$ ${bold}git log --stat -p upstream..${reset} # check your work!
|
2022-04-23 02:14:40 +02:00
|
|
|
|
2022-11-01 23:26:12 +01:00
|
|
|
\$ ${bold}git push --atomic upstream main shared-${npm_package_version}${reset}
|
2022-04-23 02:14:40 +02:00
|
|
|
|
2022-04-25 18:54:58 +02:00
|
|
|
\$ ${bold}npm publish${reset} # should prompt for an OTP, from your 2FA setup
|
2022-04-23 02:14:40 +02:00
|
|
|
"
|