pashto-dictionary/update-inflector.sh

30 lines
898 B
Bash
Raw Normal View History

2022-02-16 11:41:18 +00:00
#!/bin/bash
# updates all necessary package.json files in this monorepo with the given version for pashto inflector
2022-02-16 11:41:18 +00:00
if [ $# -eq 0 ]
then
echo "Script to update the version of @lingdocs/ps-react and @lingdocs/inflect across this monorepo"
2022-02-16 11:41:18 +00:00
echo ""
echo "usage: ./update-inlector.sh [version]"
exit 0
fi
version=$1
# update all instances of @lingdocs/inflect and @lingdocs/ps-react in various package.json files
# in website
tmp=$(mktemp)
echo $tmp
jq --arg version "$version" '.dependencies."@lingdocs/ps-react"=$version' "website/package.json" > "$tmp" && mv "$tmp" "website/package.json"
# in functions
tmp=$(mktemp)
jq --arg version "$version" '.dependencies."@lingdocs/inflect"=$version' "functions/package.json" > "$tmp" && mv "$tmp" "functions/package.json"
2022-02-16 11:41:18 +00:00
# install to update .lock files
cd website &&
2022-04-05 07:45:00 +00:00
yarn install --legacy-peer-deps &&
2022-02-16 11:41:18 +00:00
cd ../functions &&
npm install