Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-version script now updates the readme version examples correctly. #2

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Casks/g/galasactl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
url "https://github.com/galasa-dev/cli/releases/download/v#{version}/galasactl-darwin-#{arch}",
verified: "github.com/galasa-dev/cli/releases/"
name "Galasa Client"
desc "Client to interact with the Galasa ecosystem or local development environment. Latest version"
desc "Command-line client for Galasa. Latest version"
homepage "https://galasa.dev/"

livecheck do
Expand Down
2 changes: 1 addition & 1 deletion Casks/g/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
url "https://github.com/galasa-dev/cli/releases/download/v#{version}/galasactl-darwin-#{arch}",
verified: "github.com/galasa-dev/cli/releases/"
name "Galasa Client"
desc "Client to interact with the Galasa ecosystem or local development environment. Version 0.36.0"
desc "Command-line client for Galasa. Version 0.36.0"
homepage "https://galasa.dev/"

livecheck do
Expand Down
2 changes: 1 addition & 1 deletion Casks/g/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
url "https://github.com/galasa-dev/cli/releases/download/v#{version}/galasactl-darwin-#{arch}",
verified: "github.com/galasa-dev/cli/releases/"
name "Galasa Client"
desc "Client to interact with the Galasa ecosystem or local development environment. Version 0.37.0"
desc "Command-line client for Galasa. Version 0.37.0"
homepage "https://galasa.dev/"

livecheck do
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

`brew install galasa-dev/tap/<cask>`

Or `brew tap galasa-dev/tap` and then `brew install <cask>`.
Or `brew tap galasa-dev/tap` and then `brew install --no-quarantine <cask>`.

## Casks
Currently different version of casks for the Galasa Command-Line interface (galasactl). To install the latest version use the following command
Expand All @@ -20,7 +20,7 @@ brew install --no-quarantine [email protected]
```
for example
```
brew install --no-quarantine galasactl@0.36.0
brew install --no-quarantine galasactl@0.37.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.37.0
```

The file Cask/g/galasactl.rb will be updated with that version, so people can get that as the latest version.
Expand Down
5 changes: 2 additions & 3 deletions add-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#-----------------------------------------------------------------------------------------

# Where is this script executing from ?
BASEDIR=$(dirname "$0");pushd $BASEDIR 2>&1 >> /dev/null ;BASEDIR=$(pwd);popd 2>&1 >> /dev/null

Check failure on line 16 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.

Check failure on line 16 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Double quote to prevent globbing and word splitting.

Check failure on line 16 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Prefer putting braces around variable references even when not strictly required.

Check failure on line 16 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).

Check failure on line 16 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Use 'popd ... || exit' or 'popd ... || return' in case popd fails.

Check failure on line 16 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).
# echo "Running from directory ${BASEDIR}"
export ORIGINAL_DIR=$(pwd)

Check failure on line 18 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Declare and assign separately to avoid masking return values.
# cd "${BASEDIR}"

cd "${BASEDIR}/.."

Check failure on line 21 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
WORKSPACE_DIR=$(pwd)

Check failure on line 22 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

WORKSPACE_DIR appears unused. Verify use (or export if used externally).

#-----------------------------------------------------------------------------------------
#
Expand Down Expand Up @@ -77,7 +77,7 @@
function download_executable() {
url_to_download_from=$1
download_target_file_path=$2
h2 "Downloading from $url_to_download_from to $download_target_file_path"

Check failure on line 80 in add-version.sh

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Prefer putting braces around variable references even when not strictly required.
response_code=$(curl -L --silent --write-out '%{response_code}' -o $download_target_file_path $url_to_download_from)
if [[ "$response_code" != "200" ]]; then error "Failed to download version $version_to_add from url $url_to_download_from. Exit code from curl was $response_code" ; exit 1 ; fi
success "downloaded OK."
Expand Down Expand Up @@ -156,9 +156,8 @@

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
cat $BASEDIR/README.md | sed -E "s/[0-9]+[0-9\.]*/${version_to_add}/g" > ${BASEDIR}/temp/README1.md
mv ${BASEDIR}/temp/README1.md ${BASEDIR}/README.md
success "Readme updated OK."
}

Expand Down
Loading