Skip to content

Commit

Permalink
Set main as the default branch for gef-extras / gef scripts for…
Browse files Browse the repository at this point in the history
… users (#870)
  • Loading branch information
therealdreg committed Jul 5, 2022
1 parent 1499023 commit 819917d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/install.md
Expand Up @@ -79,7 +79,7 @@ This will deploy the latest version of `gef`'s _main_ branch from Github. If no
To contribute to GEF, you might prefer using git directly.

```bash
$ git clone https://github.com/hugsy/gef.git
$ git clone --branch dev https://github.com/hugsy/gef.git
$ echo source `pwd`/gef/gef.py >> ~/.gdbinit
```

Expand All @@ -106,7 +106,7 @@ $ bash -c "$(wget https://github.com/hugsy/gef/raw/main/scripts/gef-extras.sh -O

# or manually
## clone the repo
$ git clone https://github.com/hugsy/gef-extras.git
$ git clone --branch main https://github.com/hugsy/gef-extras.git

## then specify gef to load this directory
$ gdb -ex 'gef config gef.extra_plugins_dir "/path/to/gef-extras/scripts"' -ex 'gef save' -ex quit
Expand Down
8 changes: 7 additions & 1 deletion scripts/gef-extras.sh
Expand Up @@ -5,6 +5,12 @@
#
set -e

branch="main"
if [ "$1" = "dev" ]; then
branch="dev"
echo "set branch to dev"
fi

if [ $# -ge 1 ]; then
DIR="$(realpath "$1")/gef-extras"
test -d "${DIR}" || exit 1
Expand All @@ -14,7 +20,7 @@ else
DIR="${HOME}/.gef-extras"
fi

git clone https://github.com/hugsy/gef-extras.git "${DIR}"
git clone --branch ${branch} https://github.com/hugsy/gef-extras.git "${DIR}"
ver=$(gdb -q -nx -ex 'pi print(f"{sys.version_info.major}.{sys.version_info.minor}", end="")' -ex quit)
python${ver} -m pip install --requirement "${DIR}"/requirements.txt --upgrade
gdb -q -ex "gef config gef.extra_plugins_dir '${DIR}/scripts'" \
Expand Down

0 comments on commit 819917d

Please sign in to comment.