Fix update-on-ox

This commit is contained in:
Kovid Goyal 2019-09-07 09:11:49 +05:30
parent c77156d47b
commit 411cd21e82
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -51,10 +51,10 @@ def run(what):
with open(__file__, 'rb') as f:
script = f.read().decode('utf-8')
script = script[:script.find('# EOF_REMOTE')].replace('if False:', 'if True:', 1)
os.chdir(os.path.expanduser('~/work/build-calibre'))
with tempfile.NamedTemporaryFile(prefix='install-dmg-', suffix='.py') as f:
run('./osx calibre')
run('./setup.py osx --dont-shutdown')
f.write(script.encode('utf-8'))
f.flush()
run(f'scp build/osx/dist/{dmg} {f.name} {HOST}:/tmp')
run(f'scp dist/{dmg} {f.name} {HOST}:/tmp')
run(f'ssh {HOST} python /tmp/{os.path.basename(f.name)} /tmp/{dmg}')