added rough opus.temp.remove

This commit is contained in:
Fierelier 2019-12-27 15:28:49 +01:00
parent dbbd2fbf15
commit 5a669ae0cf
2 changed files with 15 additions and 9 deletions

View File

@ -18,4 +18,15 @@ def _mainExecPy(_scriptPath):
opus.main.output("done.",2)
return _return
opus.script.execute = _mainExecPy
opus.script.execute = _mainExecPy
opus.temp = Munch()
def _tempRemove():
if os.path.isdir(opus.path.temp):
opus.main.output("clearing temp directory...",1)
try:
opus.reg.unmount()
except:
pass
rtn = subprocess.call(["rmdir","/s","/q",opus.path.temp],shell=True)
opus.temp.remove = _tempRemove

View File

@ -57,13 +57,7 @@ opus.script.execute(pJoin(opus.path.main,"scripts","path.py"))
opus.main.output("",1)
if os.path.isdir(opus.path.temp):
opus.main.output("clearing temp directory...",1)
try:
opus.reg.unmount()
except:
pass
shutil.rmtree(opus.path.temp)
opus.temp.remove()
os.makedirs(pJoin(opus.path.temp,"wim"))
opus.wim.location = pJoin(opus.path.target,"sources","install.wim")
@ -90,4 +84,5 @@ for tag in opus.os.tags:
opus.main.output("\nif you'd like to make manual changes, please do so now. press enter to finalize or ctrl+c to cancel.")
input()
opus.wim.update()
opus.wim.update()
opus.temp.remove()