Handle cwd as outputdir

master
Marius Kintel 2014-06-21 19:05:50 -04:00
parent d066648390
commit 0dd3ac272b
1 changed files with 2 additions and 2 deletions

View File

@ -29,12 +29,12 @@ def createImport(inputfile, scadfile):
print ('createImport: ' + inputfile + " " + scadfile)
outputdir = os.path.dirname(scadfile)
try:
if not os.path.exists(outputdir): os.mkdir(outputdir)
if outputdir and not os.path.exists(outputdir): os.mkdir(outputdir)
f = open(scadfile,'w')
f.write('import("'+inputfile+'");'+os.linesep)
f.close()
except:
failquit('failure while opening/writing ' + scadfile)
failquit('failure while opening/writing ' + scadfile + ': ' + str(sys.exc_info()))
#