Skip to content

Commit ce10c09

Browse files
committed
restore bump-version
1 parent c8cecd7 commit ce10c09

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tools/bump-version.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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

0 commit comments

Comments
 (0)