pashto-dictionary/update-inflector.sh

29 lines
781 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
2022-02-16 11:41:18 +00:00
# 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