From bd1fe745e1b8bd24d556e062cb1af270c11cd622 Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Mon, 10 Oct 2016 14:42:05 -0400 Subject: 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. --- .gitmodules | 6 ++++++ bin/dotfiles | 21 +++++++++++++++++++++ vendor/click | 1 + vendor/py | 1 + 4 files changed, 29 insertions(+) create mode 100644 .gitmodules create mode 100755 bin/dotfiles create mode 160000 vendor/click create mode 160000 vendor/py 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 index 0000000..d3f36e8 --- /dev/null +++ b/vendor/click @@ -0,0 +1 @@ +Subproject commit d3f36e884e18f374c3e4e6cf062ba19f100d0fd6 diff --git a/vendor/py b/vendor/py new file mode 160000 index 0000000..20fb546 --- /dev/null +++ b/vendor/py @@ -0,0 +1 @@ +Subproject commit 20fb546bc78866bd25b71624b3fd70421c3baeea -- cgit v1.2.3