Last active
March 8, 2021 22:56
-
-
Save kobalab/9e82f764af3c5b3caadd2fdaea2d920b to your computer and use it in GitHub Desktop.
電脳麻将のバージョンを変更するスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
[ $1 ] || (echo "Usage: $0 version"; exit 1) | |
version=$1 | |
npx semver ${version} || (echo "${version}: bad semver"; exit 1) | |
ex package.json <<++ | |
/"version":/s/: .*$/: "${version}",/ | |
/"build:css":/s/majiang[^ ]*\.css/majiang-${version}.css/ | |
w! | |
++ | |
ex package-lock.json <<++ | |
3s/"version":.*,/"version": "${version}",/ | |
w! | |
++ | |
ex src/js/majiang.js <<++ | |
/Majiang v/s/v.*/v${version}/ | |
/VERSION:/s/'.*'/'${version}'/ | |
w! | |
++ | |
echo "- var version = '${version}'" > src/html/version.pug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment