-
-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed the update function to expose the rev in the filename
- Loading branch information
hugsy
committed
Jan 23, 2021
1 parent
ca124cf
commit aac82ac
Showing
3 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,6 +1,20 @@ | ||
#!/bin/bash | ||
|
||
wget -q -O "$HOME/.gdbinit-gef.py" https://github.com/hugsy/gef/raw/master/gef.py | ||
test -f "$HOME/.gdbinit" && mv "$HOME/.gdbinit" "$HOME/.gdbinit.old" | ||
echo "source $HOME/.gdbinit-gef.py" > "$HOME/.gdbinit" | ||
set -e | ||
|
||
exit 0 | ||
branch="master" | ||
test "$1" == "dev" && branch="dev" | ||
|
||
# Backup gdbinit if any | ||
test -f "${HOME}/.gdbinit" && mv "${HOME}/.gdbinit" "${HOME}/.gdbinit.old" | ||
|
||
# Get the hash of the commit | ||
ref=$(curl --silent https://api.github.com/repos/hugsy/gef/git/ref/heads/${branch} | grep '"sha"' | tr -s ' ' | cut -d ' ' -f 3 | tr -d "," | tr -d '"') | ||
|
||
# Download the file | ||
curl --silent --output "${HOME}/.gef-${ref}.py" "https://github.com/hugsy/gef/raw/${branch}/gef.py" | ||
|
||
# Create the new gdbinit | ||
echo "source ~/.gef-${ref}.py" > ~/.gdbinit | ||
|
||
exit 0 |
This file contains 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