-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto-update docker tag in config.json
- Loading branch information
4gac
committed
Oct 8, 2024
1 parent
6dff599
commit 71f21ff
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Check if an argument is provided | ||
if [ -z "$1" ]; then | ||
echo "No argument provided. Usage: ./update_version.sh <argument>" | ||
exit 1 | ||
fi | ||
|
||
# Check if the input is "latest" | ||
if [ "$1" == "latest" ]; then | ||
echo "Input is 'latest'. No changes made." | ||
exit 0 | ||
fi | ||
|
||
# Check if config.json exists | ||
if [ ! -f "config.json" ]; then | ||
echo "File config.json does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Replace "latest" with the provided argument in config.json | ||
sed -i "s/latest/$1/g" config.json | ||
|
||
echo "Replaced all occurrences of 'latest' with '$1' in config.json." |