diff options
author | Jon Bernard <jbernard@jbernard.io> | 2016-10-10 14:42:05 -0400 |
---|---|---|
committer | Jon Bernard <jbernard@jbernard.io> | 2016-10-11 10:39:55 -0400 |
commit | bd1fe745e1b8bd24d556e062cb1af270c11cd622 (patch) | |
tree | 40b759fd31677a6a7656915cb42f77377bdc7a64 | |
parent | 2314cbd0f20caa2321a83719f48f7b07f0814cff (diff) | |
download | dotfiles-bd1fe745e1b8bd24d556e062cb1af270c11cd622.tar.gz dotfiles-bd1fe745e1b8bd24d556e062cb1af270c11cd622.tar.bz2 dotfiles-bd1fe745e1b8bd24d556e062cb1af270c11cd622.zip |
Add dependencies as submodules
This gives you the choice to run dotfiles directly from the repository
without a virtual environment. These are only useful from the git
repository and not included in the pypi releases.
-rw-r--r-- | .gitmodules | 6 | ||||
-rwxr-xr-x | bin/dotfiles | 21 | ||||
m--------- | vendor/click | 0 | ||||
m--------- | vendor/py | 0 |
4 files changed, 27 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e46481c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "vendor/click"] + path = vendor/click + url = https://github.com/pallets/click +[submodule "vendor/py"] + path = vendor/py + url = https://github.com/pytest-dev/py diff --git a/bin/dotfiles b/bin/dotfiles new file mode 100755 index 0000000..f2e5147 --- /dev/null +++ b/bin/dotfiles @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import os +import sys + + +PROJECT_ROOT_DIRECTORY = os.path.abspath( + os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))) +PROJECT_VENDOR_DIRECTORY = os.path.join(PROJECT_ROOT_DIRECTORY, 'vendor') + +if (os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'dotfiles')) + and PROJECT_ROOT_DIRECTORY not in sys.path): + sys.path.insert(0, PROJECT_ROOT_DIRECTORY) + +for vendor in os.listdir(PROJECT_VENDOR_DIRECTORY): + vendor = os.path.join(PROJECT_VENDOR_DIRECTORY, vendor) + sys.path.insert(0, vendor) + +if __name__ == '__main__': + from dotfiles.cli import cli + cli() diff --git a/vendor/click b/vendor/click new file mode 160000 +Subproject d3f36e884e18f374c3e4e6cf062ba19f100d0fd diff --git a/vendor/py b/vendor/py new file mode 160000 +Subproject 20fb546bc78866bd25b71624b3fd70421c3baee |