Move up os.remove so that the file is removed even if it fails to execute

This commit is contained in:
David Dworken 2024-02-09 20:20:55 -08:00
parent 4744bb7317
commit b3cb2690f3
No known key found for this signature in database

View File

@ -54,7 +54,7 @@ cmd = tmpFilePath + ' install'
if os.environ.get('HISHTORY_OFFLINE'):
cmd += " --offline"
exitCode = os.system(cmd)
os.remove(tmpFilePath)
if exitCode != 0:
raise Exception("failed to install downloaded hishtory client via `" + tmpFilePath +" install` (is that directory mounted noexec? Consider setting an alternate directory via the TMPDIR environment variable)!")
os.remove(tmpFilePath)
print('Succesfully installed hishtory! Open a new terminal, try running a command, and then running `hishtory query`.')