diff --git a/package-lock.json b/package-lock.json index 2453283..06dfa27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mcopy", - "version": "1.3.2", + "version": "1.3.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0023c69..496b241 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/version.sh b/scripts/version.sh new file mode 100644 index 0000000..222e46f --- /dev/null +++ b/scripts/version.sh @@ -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 \ No newline at end of file