summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2014-10-27 20:04:00 -0400
committerAnish Athalye <me@anishathalye.com>2014-10-27 20:31:40 -0400
commit33d602bb9304b2daf54a5754f5fb51cfcad350dc (patch)
tree98209eed7081309a14612d4be5c244cc2d3257d5 /bin
parentafebc0bb2fe817778f77d0fcfe30e508bf15d441 (diff)
Add YAML support
Add support for YAML format configuration files. In addition, this commit adds instructions about YAML config files to the README, and it also changes the README to encourage use of YAML instead of JSON.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dotbot10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/dotbot b/bin/dotbot
index 2c89bb0..09e2d0e 100755
--- a/bin/dotbot
+++ b/bin/dotbot
@@ -5,6 +5,16 @@ import sys, os
PROJECT_ROOT_DIRECTORY = os.path.dirname(
os.path.dirname(os.path.realpath(__file__)))
+def inject(lib_path):
+ path = os.path.join(PROJECT_ROOT_DIRECTORY, 'lib', lib_path)
+ sys.path.insert(0, path)
+
+# version dependent libraries
+if sys.version_info.major >= 3:
+ inject('pyyaml/lib3')
+else:
+ inject('pyyaml/lib')
+
if os.path.exists(os.path.join(PROJECT_ROOT_DIRECTORY, 'dotbot')):
if PROJECT_ROOT_DIRECTORY not in sys.path:
sys.path.insert(0, PROJECT_ROOT_DIRECTORY)