Commits

Ed Brannin  committed ae6f9ad

The fabfile now works from subdirectories.

  • Participants
  • Parent commits dcbbce8

Comments (0)

Files changed (1)

File Baptism-Records/fabfile.py

 from fabric.api import *
+import os.path
+
+def _file(path):
+    "Returns the path to a file, relative to this file (as opposed to your current working dir)."
+    return os.path.join(os.path.dirname(__file__), path)
 
 def _paster(args):
     local("paster %s" % args, capture=False)
         reload = " --reload"
     else:
         reload = ''
-    command = "serve %s development.ini" % reload
+    command = "serve %s %s" % (reload, _file('development.ini'))
     _paster(command)
 
 def nuke():
-    local("rm devdata.db")
-    _paster("setup-app development.ini")
+    try:
+        local("rm %s" % _file('devdata.db'))
+    except:
+        pass
+    _paster("setup-app %s" % _file('development.ini'))
 
 def shell():
-    _paster("shell development.ini")
+    _paster("shell %s" % _file('development.ini'))