Skip to content

Commit

Permalink
scripts: add function for opening (i.e. URLs)
Browse files Browse the repository at this point in the history
  • Loading branch information
joker234 committed Dec 10, 2024
1 parent 1f8b986 commit 6c996de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
24 changes: 17 additions & 7 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ prompt_user() {


run_sed() {
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed --in-place=.bak "$1" "$2"
elif [[ "$OSTYPE" == "darwin"* ]]; then
sed -i .bak "$1" "$2"
else
printf "\nOS could not be detected. Please open report manually!\n"
fi
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sed --in-place=.bak "$1" "$2"
elif [[ "$OSTYPE" == "darwin"* ]]; then
sed -i .bak "$1" "$2"
else
printf "\nOS could not be detected. Please open report manually!\n"
fi
}

run_open() {
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
xdg-open "$1"
elif [[ "$OSTYPE" == "darwin"* ]]; then
open "$1"
else
printf "\nOS could not be detected. Please open URL manually!\n"
fi
}

# Example usage
Expand Down
8 changes: 1 addition & 7 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,4 @@ echo "✅ created new github release and tag for version: $NEW_VERSION"

JENKINS_URL="https://jenkins.heigit.org/job/OQAPI/view/tags/job/${NEW_VERSION}/"
echo "⚠️ Please start the Jenkins tag build here: ${JENKINS_URL}"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
xdg-open "$JENKINS_URL"
elif [[ "$OSTYPE" == "darwin"* ]]; then
open "$JENKINS_URL"
else
printf "\nOS could not be detected. Please open report manually!\n"
fi
run_open "$JENKINS_URL"

0 comments on commit 6c996de

Please # to comment.