Skip to content

Commit b299066

Browse files
Fix removing of file on android during livesync (#2640)
When migrating from fibers to promises, we've placed incorrect await, which prevents us when trying to remove a file from project during livesync operation. Fix the code, so removed files will be synced correctly.
1 parent 6c2148d commit b299066

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/services/livesync/android-device-livesync-service.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ class AndroidLiveSyncService implements INativeScriptDeviceLiveSyncService {
6767

6868
public async removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectId: string): Promise<void> {
6969
let deviceRootPath = this.getDeviceRootPath(appIdentifier);
70-
_.each(localToDevicePaths, localToDevicePathData => {
70+
71+
for (let localToDevicePathData of localToDevicePaths) {
7172
let relativeUnixPath = _.trimStart(helpers.fromWindowsRelativePathToUnix(localToDevicePathData.getRelativeToProjectBasePath()), "/");
7273
let deviceFilePath = this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync", relativeUnixPath);
73-
this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), "&& await ", "touch", deviceFilePath]);
74-
});
74+
await this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), " && ", "touch", deviceFilePath]);
75+
}
7576

7677
await this.getDeviceHashService(projectId).removeHashes(localToDevicePaths);
7778
}

0 commit comments

Comments
 (0)