Add a "version.sh" shell script to bump the version of the app and distribute it throughout the repo.
This commit is contained in:
parent
74e6b9c1b2
commit
79e16fb166
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.4",
|
||||
"description": "Small gauge film optical printer platform",
|
||||
"main": "build.js",
|
||||
"directories": {
|
||||
|
@ -9,7 +9,9 @@
|
|||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "sh ./scripts/build.sh"
|
||||
"build": "sh ./scripts/build.sh",
|
||||
"patch": "sh ./scripts/version.sh patch",
|
||||
"minor": "sh ./scripts/version.sh minor"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
npm version --no-git-tag-version ${1}
|
||||
|
||||
#version all sub projects and config files
|
||||
version=$(jq -r '.version' ./package.json)
|
||||
echo "VERSION: $version"
|
||||
|
||||
declare -a fileArr=("./data/cfg.json" "./app/package.json" "./cli/package.json")
|
||||
|
||||
for i in "${fileArr[@]}"
|
||||
do
|
||||
tmp=$(mktemp)
|
||||
VERSION="$version" jq '.version = env.VERSION' "$i" > "$tmp" && mv "$tmp" "$i"
|
||||
done
|
Loading…
Reference in New Issue