Skip to content

Commit b7c090f

Browse files
committed
Expand to full switch and update script
Script is manually updated from the copy used in the skeleton repositories, specifically from cisagov/skeleton-python-library.
1 parent ac68995 commit b7c090f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
66

77
COPY requirements.txt .
88

9-
RUN pip install --no-cache-dir -r requirements.txt
9+
RUN pip install --no-cache-dir --requirement requirements.txt
1010

1111
COPY . .
1212

bump_version.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ VERSION_FILE=trustymail/__init__.py
1010

1111
HELP_INFORMATION="bump_version.sh (show|major|minor|patch|prerelease|build|finalize)"
1212

13-
old_version=$(sed -n "s/^__version__ = '\(.*\)'$/\1/p" $VERSION_FILE)
13+
old_version=$(sed -n "s/^__version__ = \"\(.*\)\"$/\1/p" $VERSION_FILE)
1414

1515
if [ $# -ne 1 ]
1616
then
@@ -20,17 +20,25 @@ else
2020
major|minor|patch|prerelease|build)
2121
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
2222
echo Changing version from "$old_version" to "$new_version"
23-
sed -i "s/$old_version/$new_version/" $VERSION_FILE
23+
# A temp file is used to provide compatability with macOS development
24+
# as a result of macOS using the BSD version of sed
25+
tmp_file=/tmp/version.$$
26+
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
27+
mv $tmp_file $VERSION_FILE
2428
git add $VERSION_FILE
2529
git commit -m"Bump version from $old_version to $new_version"
2630
git push
2731
;;
2832
finalize)
2933
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
3034
echo Changing version from "$old_version" to "$new_version"
31-
sed -i "s/$old_version/$new_version/" $VERSION_FILE
35+
# A temp file is used to provide compatability with macOS development
36+
# as a result of macOS using the BSD version of sed
37+
tmp_file=/tmp/version.$$
38+
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
39+
mv $tmp_file $VERSION_FILE
3240
git add $VERSION_FILE
33-
git commit -m"Finalize version from $old_version to $new_version"
41+
git commit -m"Bump version from $old_version to $new_version"
3442
git push
3543
;;
3644
show)

0 commit comments

Comments
 (0)