diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-22 18:08:04 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-22 18:08:04 +0000 |
commit | 6b96eeda9bacec7edc95690f2ca61d319045f5de (patch) | |
tree | d6073b04a4ca7fcee1638ed8b6352a606dc58e97 /morph | |
parent | 5e3381945ae955419fc4cf760b5126d249f3357a (diff) | |
download | morph-6b96eeda9bacec7edc95690f2ca61d319045f5de.tar.gz |
Implement the "morph mine" subcommand
Diffstat (limited to 'morph')
-rwxr-xr-x | morph | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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) |