Skip to content

Commit 2346442

Browse files
committed
```
feat: Update installation script and implement Alias This commit includes significant updates to the install.sh script. A critical section where the user was asked to enter their OpenAI API key was removed. This section includes reading and storing the API key to a bash variable and then exporting it to the bashrc file 🗂️. In addition, the GitHub CLI extension installation line was corrected from `ghcli/commit` to `ghcli/gh-commit`. This ensures that the correct extension is installed 📝. A new Git alias called 'auto-commit' has been created. This was then appended to the bashrc file to make it globally available. Sourcing the bashrc file ensures our new alias is available instantly after installation 🌍. Updated the final output to include usage of the new auto-commit feature for the user's convenience. Let's enjoy a streamlined Git commit process now 🚀! ```
1 parent cf74e99 commit 2346442

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

install.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,19 @@ then
66
exit
77
fi
88

9-
echo "Please enter your OpenAI API key:"
10-
read OPENAI_API_KEY
11-
echo "You entered: $OPENAI_API_KEY"
12-
13-
echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> ~/.bashrc
14-
source ~/.bashrc
15-
169
# Print the latest release binary
1710
LATEST_RELEASE=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/ghcli/gh-commit/releases --jq '.[0].tag_name')
1811
echo "Latest release: $LATEST_RELEASE"
1912

2013
# Install GitHub CLI extension
21-
gh extension install ghcli/commit
14+
gh extension install ghcli/gh-commit
2215

2316
# Create Git alias
2417
git config --global alias.auto-commit '!git commit -m "$(gh commit)" || git commit -a -m "$(gh commit)" && git log HEAD...HEAD~1'
18+
echo "alias auto-commit='git commit -m \"\$(gh commit)\" || git commit -a -m \"\$(gh commit)\" && git log HEAD...HEAD~1'" >> ~/.bashrc
19+
source ~/.bashrc
2520

2621
echo "Commit GitHub CLI extension installed successfully!"
2722
echo "Usage: git auto-commit"
28-
echo "Usage: gh commit"
23+
echo "Usage: gh commit"
24+
echo "Usage: auto-commit"

0 commit comments

Comments
 (0)