pashto-dictionary/update-inflector.sh

32 lines
979 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 latest given version for pashto inflector
version=$1
2022-02-16 11:41:18 +00:00
if [ $# -eq 0 ]
then
version=$(npm show @lingdocs/ps-react version)
2022-02-16 11:41:18 +00:00
fi
# 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-11-02 05:28:14 +00:00
# in account
tmp=$(mktemp)
jq --arg version "$version" '.dependencies."@lingdocs/inflect"=$version' "account/package.json" > "$tmp" && mv "$tmp" "account/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 &&
2022-11-02 05:28:14 +00:00
npm install &&
cd ../account &&
2022-02-16 11:41:18 +00:00
npm install