Refactor: More f-string

This commit is contained in:
pagedown
2022-01-28 19:34:13 +08:00
parent e0c4a90aa3
commit dc61adf9d8
14 changed files with 35 additions and 54 deletions

View File

@@ -16,17 +16,17 @@ if False:
dmg = sys.argv[-1]
mp = tempfile.mkdtemp()
atexit.register(os.rmdir, mp)
subprocess.check_call('hdiutil attach {} -mountpoint {}'.format(dmg, mp).split())
subprocess.check_call(f'hdiutil attach {dmg} -mountpoint {mp}'.split())
try:
os.chdir(mp)
for app in glob.glob('*.app'):
d = os.path.join('/Applications', app)
if os.path.exists(d):
shutil.rmtree(d)
subprocess.check_call('ditto -v {} {}'.format(app, os.path.join('/Applications', app)).split())
subprocess.check_call(f'ditto -v {app} {d}'.split())
finally:
os.chdir('/')
subprocess.check_call('hdiutil detach {}'.format(mp).split())
subprocess.check_call(f'hdiutil detach {mp}'.split())
# EOF_REMOTE