File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ if [ "$1" == "latest" ]; then
1717 exit 0
1818fi
1919
20+ version=$1
21+
22+ echo " Version: ${version} "
23+
24+
25+ # config.json
2026# Check if config.json exists
2127if [ ! -f " config.json" ]; then
2228 echo " File config.json does not exist."
2531
2632# Replace in config.json in "version" : "v0.0.0"
2733# "v0.0.0" in with the provided argument
28- sed -i " s|v0\.0\.0|$1 |g" config.json
34+ sed -i.bak " s|v0\.0\.0|${version} |g" config.json && rm config.json.bak
2935
30- echo " Replaced all occurrences of 'v0.0.0' with '$1 ' in config.json."
36+ echo " Replaced all occurrences of 'v0.0.0' with '${version} ' in config.json."
3137
3238# Replace "latest" with the provided argument in config.json
33- sed -i " s|latest|$1 |g" config.json
39+ sed -i.bak " s|latest|${version} |g" config.json && rm config.json.bak
40+
41+ echo " Replaced all occurrences of 'latest' with '${version} ' in config.json."
42+
43+
44+ # README.md
45+ # Check if README.md exists
46+ if [ ! -f " README.md" ]; then
47+ echo " File README.md does not exist."
48+ exit 1
49+ fi
50+
51+ # Replace "latest" with the provided argument in README.md
52+ sed -i.bak " s/:latest/:${version} /g" README.md && rm README.md.bak
3453
35- echo " Replaced all occurrences of 'latest' with '$1 ' in config.json ."
54+ echo " Replaced all occurrences of 'latest' with '${version} ' in README.md ."
You can’t perform that action at this time.
0 commit comments