Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/tools/bump-version.sh
1146 views
1
#!/usr/bin/env bash
2
3
if [[ -z "${1}" || -z "${2}" ]]; then
4
echo "Error: missing arguments"
5
exit 1
6
fi
7
8
if [[ ! -f beef || ! -f VERSION ]]; then
9
echo "Error: must be run from within the BeEF root directory"
10
exit 1
11
fi
12
13
echo "Updating version ${1} to ${2}"
14
15
git checkout -b "release/${2}"
16
sed -i '' -e "s/$1/$2/g" VERSION
17
sed -i '' -e "s/\"version\": \"$1\"/\"version\": \"$2\"/g" package.json
18
sed -i '' -e "s/\"version\": \"$1\"/\"version\": \"$2\"/g" package-lock.json
19
sed -i '' -e "s/\"version\": \"$1\"/\"version\": \"$2\"/g" config.yaml
20
21
git add VERSION package.json package-lock.json config.yaml
22
git commit -m "Version bump ${2}"
23
git push --set-upstream origin "release/${2}"
24
git push
25
26