generated from jsburckhardt/getting-started
-
Notifications
You must be signed in to change notification settings - Fork 1
<
8000
div id="files_bucket" class="files-bucket files-next-bucket clearfix pull-request-tab-content is-visible js-multi-line-comments-enabled">
Show file tree
Hide file tree
Sep 12, 2024
Sep 12, 2024
Sep 12, 2024
Sep 12, 2024
Sep 12, 2024
Sep 12, 2024
Feat/add installation script #11
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5222f60
feat(devcontainer, ci): update devcontainer configuration and CI script
jsburckhardt 8d60305
docs(cmd): add package comment for command-line interface
jsburckhardt 5ce4d61
feat(logging): add info log for commit messages before execution
jsburckhardt 2ef6146
fix(cmd): correct string concatenation for commit message logging
jsburckhardt 067b904
fix(cmd): standardize log output for commit message formatting
jsburckhardt b1253ac
chore(ci): disable test execution step in CI workflow
jsburckhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,63 @@ | ||
#!/bin/bash | ||
|
||
# Variables | ||
REPO_OWNER="jsburckhardt" | ||
REPO_NAME="gic" | ||
BINARY_NAME="gic" | ||
|
||
# Function to get the latest version from GitHub API | ||
get_latest_version() { | ||
LATEST_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest" | ||
curl -s "$LATEST_URL" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | ||
} | ||
|
||
# Check if a version is passed as an argument | ||
if [ -z "$1" ]; then | ||
# No version provided, get the latest version | ||
VERSION=$(get_latest_version) | ||
echo "No version provided, installing the latest version: $VERSION" | ||
else | ||
VERSION=$1 | ||
echo "Installing specified version: $VERSION" | ||
fi | ||
|
||
# Determine the OS and architecture following the naming template | ||
OS=$(uname | tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m) | ||
|
||
if [ "$ARCH" == "x86_64" ]; then | ||
ARCH="x86_64" | ||
elif [ "$ARCH" == "i686" ]; then | ||
ARCH="i386" | ||
elif [ "$ARCH" == "armv7l" ]; then | ||
ARCH="armv7" | ||
elif [ "$ARCH" == "aarch64" ]; then | ||
ARCH="arm64" | ||
fi | ||
|
||
# Construct the download URL to match the naming template | ||
DOWNLOAD_URL="https://github.com/$REPO_OWNER/$REPO_NAME/releases/download/$VERSION/${REPO_NAME}_$(echo "$OS" | sed 's/.*/\u&/')_$ARCH.tar.gz" | ||
|
||
# Create a temporary directory for the download | ||
TMP_DIR=$(mktemp -d) | ||
cd "$TMP_DIR" || exit | ||
|
||
# Download the binary tarball | ||
echo "Downloading $BINARY_NAME from $DOWNLOAD_URL" | ||
curl -LO "$DOWNLOAD_URL" | ||
|
||
# Extract the tarball | ||
echo "Extracting the tarball" | ||
tar -xzf "${REPO_NAME}_$(echo "$OS" | sed 's/.*/\u&/')_$ARCH.tar.gz" | ||
|
||
# Move the binary to /usr/local/bin | ||
echo "Installing $BINARY_NAME" | ||
sudo mv $BINARY_NAME /usr/local/bin/ | ||
|
||
# Cleanup | ||
cd - || exit | ||
rm -rf "$TMP_DIR" | ||
|
||
# Verify installation | ||
echo "Verifying installation" | ||
$BINARY_NAME --version |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.