Skip to content

Commit

Permalink
feat: a git hook to update ic submodule on git pull
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Sep 19, 2023
1 parent ad33c2c commit b0e0c99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 35 deletions.
42 changes: 7 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,6 @@

## 1. Install dependencies

### SQLite

#### On Linux

Installing SQLite with dev dependencies:

``` bash
sudo apt install -y sqlite3 libsqlite3-dev
```

#### On Mac OS

``` bash
brew install sqlite
```

#### Note on errors caused wrong ordering of setup

Note: This SQLite dependency must be installed before you install a python
version using pyenv, or the extension will not be compiled in your python. If
you get an error like

``` bash
ModuleNotFoundError: No module named '_sqlite3'
```

You need to remove your pyenv python version

``` bash
pyenv uninstall <version>
```

and reinstall it again (see below).

### pipenv / pyenv

#### On Linux
Expand Down Expand Up @@ -232,7 +198,7 @@ To start the release dashboard locally, run the following from dashboard folder
yarn dev
```

To use release_cli with the local dashboard instance run it with `--dev` flag.
To use `release_cli` with the local dashboard instance run it with `--dev` flag.

E.g.

Expand All @@ -244,6 +210,12 @@ release_cli --dev subnet --id <id> replace -o1

## Updating the ic git submodule

There is a script that can configure git to automatically check out the latest committed version of the IC submodule on every git pull. Please make sure you run this script at least once after cloning the repo.
```
git-hooks-install
```

To check out the latest version of the IC repo (submodule), you can run:
```
git submodule foreach -q git fetch origin
git submodule foreach -q git checkout master
Expand Down
16 changes: 16 additions & 0 deletions git-hooks-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

BASEDIR=$(git rev-parse --show-toplevel)

echo -n "Creating the post-merge hook file (also called after git pull)... "

cat >"$BASEDIR/.git/hooks/post-merge" <<_EOF
#!/bin/sh
echo "Updating submodules"
git submodule update --init --recursive
_EOF

# Make it executable
chmod +x .git/hooks/post-merge

echo done

0 comments on commit b0e0c99

Please sign in to comment.