Skip to content

Commit 375b052

Browse files
committed
refactor: __file_changed_messages()
- Include some lines that where outside inside the method. - Update checks for file transfer in VUE apps
1 parent da1b779 commit 375b052

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

products/nativescript/tns_logs.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,7 @@ def run_messages(app_name, platform, run_type=RunType.FULL, bundle=False, hmr=Fa
8888

8989
# File transfer messages
9090
logs.extend(TnsLogs.__file_changed_messages(run_type=run_type, file_name=file_name, platform=platform,
91-
bundle=bundle, hmr=hmr, uglify=uglify, aot=aot))
92-
if run_type in [RunType.FIRST_TIME, RunType.FULL]:
93-
if not bundle and not hmr:
94-
if platform == Platform.IOS:
95-
logs.append('Successfully transferred all files on device')
96-
if bundle or hmr:
97-
if platform == Platform.IOS:
98-
logs.append('Successfully transferred bundle.js on device')
99-
logs.append('Successfully transferred package.json on device')
100-
logs.append('Successfully transferred starter.js on device')
101-
logs.append('Successfully transferred vendor.js on device')
91+
bundle=bundle, hmr=hmr, uglify=uglify, aot=aot, app_type=app_type))
10292

10393
# App restart messages:
10494
if TnsLogs.__should_restart(run_type=run_type, bundle=bundle, hmr=hmr, file_name=file_name):
@@ -125,7 +115,7 @@ def run_messages(app_name, platform, run_type=RunType.FULL, bundle=False, hmr=Fa
125115
return logs
126116

127117
@staticmethod
128-
def __file_changed_messages(run_type, file_name, platform, bundle, hmr, uglify, aot=False):
118+
def __file_changed_messages(run_type, file_name, platform, bundle, hmr, uglify, aot=False, app_type=None):
129119
logs = []
130120
if file_name is None:
131121
if run_type not in [RunType.FIRST_TIME, RunType.FULL]:
@@ -160,6 +150,18 @@ def __file_changed_messages(run_type, file_name, platform, bundle, hmr, uglify,
160150
else:
161151
# If bundle is not used then TS files are transpiled and synced as JS
162152
logs.append('Successfully transferred {0}'.format(file_name.replace('.ts', '.js')))
153+
154+
# Migrated
155+
if run_type in [RunType.FIRST_TIME, RunType.FULL]:
156+
if platform == Platform.IOS:
157+
if (bundle or hmr) and app_type != AppType.VUE:
158+
logs.append('Successfully transferred bundle.js on device')
159+
logs.append('Successfully transferred package.json on device')
160+
logs.append('Successfully transferred starter.js on device')
161+
logs.append('Successfully transferred vendor.js on device')
162+
else:
163+
logs.append('Successfully transferred all files on device')
164+
163165
return logs
164166

165167
@staticmethod

0 commit comments

Comments
 (0)