From 6cbfd8191eba41fd368ded567d81f545e7dca920 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 12 Jun 2011 18:30:18 -0400 Subject: [PATCH] loc --- fabfile.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fabfile.py b/fabfile.py index 7524f52..c4c72e2 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import os from fabric.api import * @@ -11,6 +12,18 @@ def _run(cmd): local(CMD_TEMPLATE.format(cmd)) +def _path_to(*loc): + path_tree = __file__.split('/')[:-1] + path_tree.extend(loc) + + return '/'.join(path_tree) + + +def docs(): + os.chdir(_path_to('docs')) + os.system('make') + + def prod(): """Runs all command on the production instance.""" global CMD_TEMPLATE