Skip to content

Commit

Permalink
script updates the readme examples also.
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
  • Loading branch information
techcobweb committed Aug 15, 2024
1 parent e9c3273 commit 7b27e90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ brew install --no-quarantine galasactl@x.xx.x
```
for example
```
brew install --no-quarantine galasactl@0.33.0
brew install --no-quarantine galasactl@0.36.0
```

At the moment the --no-quarantine is required because otherwise its not possible to run the galasactl. See documentation about this at
Expand All @@ -31,7 +31,7 @@ Use the helper script `add-version.sh`

For example:
```bash
./add-version.sh --version 0.36.0
./add-version.sh --version 0.36.0
```

The file Cask/g/galasactl.rb will be updated with that version, so people can get that as the latest version.
Expand Down
11 changes: 11 additions & 0 deletions add-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ EOF
success "Formula file updated OK."
}


function update_readme_example() {
h2 "Updating the example in the readme."
cat $BASEDIR/README.md | sed "s/brew install --no-quarantine galasactl@[0-9.]+/brew install --no-quarantine galasactl@${version_to_add}/1" > ${BASEDIR}/temp/README1.md
cat ${BASEDIR}/temp/README1.md | sed "s/add-version.sh --version .* /add-version.sh --version ${version_to_add}/1" > ${BASEDIR}/temp/README2.md
mv ${BASEDIR}/temp/README2.md ${BASEDIR}/README.md
success "Readme updated OK."
}

#-----------------------------------------------------------------------------------------
# Process parameters
#-----------------------------------------------------------------------------------------
Expand Down Expand Up @@ -206,4 +215,6 @@ create_new_version_formula $x86_checksum $arm64_checksum

update_latest_formula $x86_checksum $arm64_checksum

update_readme_example

success "All done OK."

0 comments on commit 7b27e90

Please sign in to comment.