Skip to content

Commit

Permalink
Package suggested git script with Python package
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-p-marques committed Oct 21, 2021
1 parent 640fe37 commit 79dab85
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
15 changes: 2 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,8 @@ To upgrade git-autoshare at any time::

$ pipx upgrade git-autoshare

If you want ``git autoshare-clone`` to be invoked transparently in place of ``git clone``,
create the following bash script, name it ``git``, and place it in your ``PATH`` before ``/usr/bin/git``:

.. code:: bash
#!/bin/bash
if [ "$1" == "clone" ]
then
shift
/usr/bin/git autoshare-clone "$@"
else
/usr/bin/git "$@"
fi
This will also install a simple script to transparently replace your calls to ``git clone`` with calls to
``git autoshare-clone``. To enable it, set the `GIT_AUTOSHARE=1` variable in your shell to a positive value.

Usage
~~~~~
Expand Down
8 changes: 8 additions & 0 deletions scripts/git
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
if [[ "$GIT_AUTOSHARE" == "1" && "$1" == "clone" ]]
then
shift
/usr/bin/git autoshare-clone "$@"
else
/usr/bin/git "$@"
fi
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@
"git-autoshare-submodule-add=git_autoshare.submodule:add",
]
},
scripts=["scripts/git"]
)

0 comments on commit 79dab85

Please sign in to comment.