mirror of https://gitlab.com/bashrc2/epicyon
Create directories
parent
b458e06feb
commit
79048c29b9
15
git.py
15
git.py
|
@ -83,7 +83,10 @@ def receiveGitPatch(baseDir: str, nickname: str, domain: str,
|
||||||
|
|
||||||
patchLines = contentStr.split('\n')
|
patchLines = contentStr.split('\n')
|
||||||
patchFilename = None
|
patchFilename = None
|
||||||
patchDir = None
|
projectDir = None
|
||||||
|
patchesDir = \
|
||||||
|
baseDir + '/accounts/' + nickname + '@' + domain + \
|
||||||
|
'/patches'
|
||||||
# get the subject line and turn it into a filename
|
# get the subject line and turn it into a filename
|
||||||
for line in patchLines:
|
for line in patchLines:
|
||||||
if line.startswith('Subject:'):
|
if line.startswith('Subject:'):
|
||||||
|
@ -93,11 +96,13 @@ def receiveGitPatch(baseDir: str, nickname: str, domain: str,
|
||||||
patchSubject = patchSubject.replace(' ', '_')
|
patchSubject = patchSubject.replace(' ', '_')
|
||||||
projectName = \
|
projectName = \
|
||||||
getGitProjectName(baseDir, nickname, domain, subject)
|
getGitProjectName(baseDir, nickname, domain, subject)
|
||||||
patchDir = \
|
if not os.path.isdir(patchesDir):
|
||||||
baseDir + '/accounts/' + nickname + '@' + domain + \
|
os.mkdir(patchesDir)
|
||||||
'/patches/' + projectName
|
projectDir = patchesDir + '/' + projectName
|
||||||
|
if not os.path.isdir(projectDir):
|
||||||
|
os.mkdir(projectDir)
|
||||||
patchFilename = \
|
patchFilename = \
|
||||||
patchDir + '/' + patchSubject + '.patch'
|
projectDir + '/' + patchSubject + '.patch'
|
||||||
break
|
break
|
||||||
if not patchFilename:
|
if not patchFilename:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue