def make_git(self, path):
if path.startswith('/'):
path = os.path.normpath(path)
if not path.startswith(self.path):
raise Exception('can not create git outside workspace')
path = os.path.join(self.root, self.uid, path)
try: # create the target directory
os.makedirs(path)
except OSError, e:
if e.errno != errno.EEXIST:
raise Exception(
'could not create directory at %s: %s' % (path, str(e))
)
ave.git.init(path)
msg = 'Created by avi.workpace.make_git()'
ave.git.commit(path, msg, allow_empty=True)
return path
评论列表
文章目录