forked from tankaru/OpenSwitchMaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinc_patch.sh
32 lines (23 loc) · 1.04 KB
/
inc_patch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Increment version number in manifest.json
manifest_file="src/manifest.json"
package_file="package.json"
package_lock_file="package-lock.json"
version=$(sed -n 's/.*"version": "\(.*\)",/\1/p' $manifest_file)
a=(${version//./ })
((a[2]++))
new_version="${a[0]}.${a[1]}.${a[2]}"
echo "Version updated from $version to $new_version"
echo "Write to $manifest_file"
# sed -i "s/\"version\": \"$version\"/\"version\": \"$new_version\"/g" $manifest_file
# macos version
sed -i "" "s/\"version\": \"$version\"/\"version\": \"$new_version\"/g" $manifest_file
echo "Write to $package_file"
# sed -i "s/\"version\": \"$version\"/\"version\": \"$new_version\"/g" $manifest_file
# macos version
sed -i "" "s/\"version\": \"$version\"/\"version\": \"$new_version\"/g" $package_file
echo "Write to $package_lock_file"
# sed -i "s/\"version\": \"$version\"/\"version\": \"$new_version\"/g" $manifest_file
# macos version
# TODO: Limit to only the first 2 occurances
sed -i "" "s/\"version\": \"$version\"/\"version\": \"$new_version\"/g" $package_lock_file