Fix infinite loop in sky_tool listen if you didn’t specify —local-build
This commit is contained in:
parent
e30b436d1a
commit
ec503ea9b8
@ -632,55 +632,54 @@ class StartListening(object):
|
|||||||
]
|
]
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
|
|
||||||
if not args.local_build:
|
if args.local_build:
|
||||||
# Currently sending to iOS only works if you are building Sky locally
|
# Currently sending to iOS only works if you are building Sky locally
|
||||||
# since we aren't shipping the sky_snapshot binary yet.
|
# since we aren't shipping the sky_snapshot binary yet.
|
||||||
continue
|
|
||||||
|
|
||||||
# Build the snapshot
|
# Check if we can make a snapshot
|
||||||
if args.ios_sim_build_available:
|
sky_snapshot_path = None
|
||||||
sky_snapshot_path = os.path.join(args.sky_src_path, args.ios_sim_debug_build_path, 'clang_x64', 'sky_snapshot')
|
if args.ios_sim_build_available:
|
||||||
elif args.ios_build_available:
|
sky_snapshot_path = os.path.join(args.sky_src_path, args.ios_sim_debug_build_path, 'clang_x64', 'sky_snapshot')
|
||||||
sky_snapshot_path = os.path.join(args.sky_src_path, args.ios_debug_build_path, 'clang_x64', 'sky_snapshot')
|
elif args.ios_build_available:
|
||||||
else:
|
sky_snapshot_path = os.path.join(args.sky_src_path, args.ios_debug_build_path, 'clang_x64', 'sky_snapshot')
|
||||||
# If there is no build available, we can't make a snapshot
|
|
||||||
continue
|
|
||||||
|
|
||||||
cmd = [
|
if sky_snapshot_path is not None:
|
||||||
sky_snapshot_path,
|
# If we can make a snapshot, do so and then send it to running iOS instances
|
||||||
'--package-root=packages',
|
cmd = [
|
||||||
'--snapshot=' + os.path.join(tempdir, 'snapshot_blob.bin'),
|
sky_snapshot_path,
|
||||||
os.path.join('lib', 'main.dart')
|
'--package-root=packages',
|
||||||
]
|
'--snapshot=' + os.path.join(tempdir, 'snapshot_blob.bin'),
|
||||||
subprocess.check_call(cmd)
|
os.path.join('lib', 'main.dart')
|
||||||
|
]
|
||||||
|
subprocess.check_call(cmd)
|
||||||
|
|
||||||
os.chdir(tempdir)
|
os.chdir(tempdir)
|
||||||
# Turn the snapshot into an app.skyx file
|
# Turn the snapshot into an app.skyx file
|
||||||
cmd = [
|
cmd = [
|
||||||
'zip',
|
'zip',
|
||||||
'-r',
|
'-r',
|
||||||
'app.skyx',
|
'app.skyx',
|
||||||
'snapshot_blob.bin',
|
'snapshot_blob.bin',
|
||||||
'action',
|
'action',
|
||||||
'content',
|
'content',
|
||||||
'navigation'
|
'navigation'
|
||||||
]
|
]
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
os.chdir(currdir)
|
os.chdir(currdir)
|
||||||
|
|
||||||
# Copy the app.skyx to the running simulator
|
# Copy the app.skyx to the running simulator
|
||||||
simulator_app_documents_dir = IOSSimulator.get_simulator_app_documents_dir()
|
simulator_app_documents_dir = IOSSimulator.get_simulator_app_documents_dir()
|
||||||
if simulator_app_documents_dir is not None:
|
if simulator_app_documents_dir is not None:
|
||||||
cmd = [
|
cmd = [
|
||||||
'cp',
|
'cp',
|
||||||
os.path.join(tempdir, 'app.skyx'),
|
os.path.join(tempdir, 'app.skyx'),
|
||||||
simulator_app_documents_dir
|
simulator_app_documents_dir
|
||||||
]
|
]
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
|
|
||||||
# Copy the app.skyx to the attached iOS device
|
# Copy the app.skyx to the attached iOS device
|
||||||
if IOSDevice.is_connected():
|
if IOSDevice.is_connected():
|
||||||
IOSDevice.copy_file(SKY_SHELL_APP_ID, os.path.join(tempdir, 'app.skyx'), 'Documents/app.skyx')
|
IOSDevice.copy_file(SKY_SHELL_APP_ID, os.path.join(tempdir, 'app.skyx'), 'Documents/app.skyx')
|
||||||
|
|
||||||
# Watch filesystem for changes
|
# Watch filesystem for changes
|
||||||
if not self.watch_dir(currdir):
|
if not self.watch_dir(currdir):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user