Skip to content

Commit 789e267

Browse files
authored
Merge pull request #3 from matthieu-pa/master
GIT_PARENT_DIR fix
2 parents 8b62d2c + fe17e7e commit 789e267

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jupyter nbextension enable --py githubcommit
2626
## Steps
2727

2828
* Install package using above commands
29-
* Create Git repo where notebooks will be pushed if not already exists and clone it in home directory
30-
* Clone this repo as well in home directory
29+
* Create Git repo where notebooks will be pushed if not already exists and clone it in your `GIT_PARENT_DIR`
30+
* Clone this repo as well in your `GIT_PARENT_DIR` directory
3131
* Replace the values in env.sh present in this repo itself
3232
* Run the command - source ~/githubcommit/env.sh
3333
* Configure ssh key (present in ~/.ssh/id_rsa.pub or specified location) in github account

env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export GIT_REMOTE_UPSTREAM=$GIT_USER_UPSTREAM/$GIT_REPO_NAME
2323

2424

2525
####################### Git Repo where notebooks will be pushed ############
26-
cd ~ && git clone $GIT_REMOTE_URL_HTTPS
26+
cd $GIT_PARENT_DIR && git clone $GIT_REMOTE_URL_HTTPS
2727

2828

2929

@@ -34,4 +34,4 @@ fi
3434

3535
echo 'c.NotebookApp.disable_check_xsrf = True' >> ~/.jupyter/jupyter_notebook_config.py
3636

37-
cp ~/githubcommit/config ~/.ssh/config
37+
cp $GIT_PARENT_DIR/githubcommit/config ~/.ssh/config

githubcommit/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def put(self):
5454
# commit current notebook
5555
# client will sent pathname containing git directory; append to git directory's parent
5656
try:
57-
print(repo.git.add(str(os.path.expanduser('~') + "/" + os.environ.get('GIT_REPO_NAME') + filename)))
57+
print(repo.git.add(str(os.environ.get('GIT_PARENT_DIR') + "/" + os.environ.get('GIT_REPO_NAME') + filename)))
5858
print(repo.git.commit( a=True, m="{}\n\nUpdated {}".format(msg, filename) ))
5959
except GitCommandError as e:
6060
print(e)

0 commit comments

Comments
 (0)