diff --git a/README.rst b/README.rst index 90c007e..54badfb 100644 --- a/README.rst +++ b/README.rst @@ -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, export `GIT_AUTOSHARE=1` in your shell. Usage ~~~~~ diff --git a/scripts/git b/scripts/git new file mode 100755 index 0000000..482de3f --- /dev/null +++ b/scripts/git @@ -0,0 +1,8 @@ +#!/bin/bash +if [[ "$GIT_AUTOSHARE" == "1" && "$1" == "clone" ]] +then + shift + /usr/bin/git autoshare-clone "$@" +else + /usr/bin/git "$@" +fi \ No newline at end of file diff --git a/setup.py b/setup.py index 4b6e074..23f447f 100644 --- a/setup.py +++ b/setup.py @@ -32,4 +32,5 @@ "git-autoshare-submodule-add=git_autoshare.submodule:add", ] }, + scripts=["scripts/git"] )