summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-22 18:08:04 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-22 18:08:04 +0000
commit6b96eeda9bacec7edc95690f2ca61d319045f5de (patch)
treed6073b04a4ca7fcee1638ed8b6352a606dc58e97 /morph
parent5e3381945ae955419fc4cf760b5126d249f3357a (diff)
downloadmorph-6b96eeda9bacec7edc95690f2ca61d319045f5de.tar.gz
Implement the "morph mine" subcommand
Diffstat (limited to 'morph')
-rwxr-xr-xmorph13
1 files changed, 13 insertions, 0 deletions
diff --git a/morph b/morph
index 5b1bed7b..fdfad8a1 100755
--- a/morph
+++ b/morph
@@ -377,6 +377,19 @@ class Morph(cliapp.Application):
os.mkdir(os.path.join(dirname, '.morph'))
os.mkdir(os.path.join(dirname, '.morph', 'cache'))
+ def cmd_minedir(self, args):
+ '''Find morph mine directory from current working directory.'''
+
+ dirname = os.getcwd()
+ while dirname != '/':
+ dot_morph = os.path.join(dirname, '.morph')
+ if os.path.isdir(dot_morph):
+ self.output.write('%s\n' % dirname)
+ return
+ dirname = os.path.dirname(dirname)
+
+ raise cliapp.AppException("Can't find the mine directory")
+
def msg(self, msg):
'''Show a message to the user about what is going on.'''
logging.debug(msg)