Skip to content

Commit 4644048

Browse files
author
Tsvetan Raikov
committed
Fixed: getfile/putfile operate with global files (not local ones)
1 parent c53e36f commit 4644048

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

lib/services/livesync/platform-livesync-service.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
4343
if (this.shouldTransferAllFiles(platform, deviceAppData)) {
4444
localToDevicePaths = this.$projectFilesManager.createLocalToDevicePaths(deviceAppData, projectFilesPath, null, this.liveSyncData.excludedProjectDirsAndFiles);
4545
this.transferFiles(deviceAppData, localToDevicePaths, this.liveSyncData.projectFilesPath, true).wait();
46-
device.fileSystem.putFile(this.$projectChangesService.getPrepareInfoFilePath(platform), this.getLiveSyncInfoFilePath(deviceAppData)).wait();
46+
device.fileSystem.putFile(this.$projectChangesService.getPrepareInfoFilePath(platform), this.getLiveSyncInfoFilePath(deviceAppData), appIdentifier).wait();
4747
}
4848

4949
if (postAction) {
@@ -194,7 +194,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
194194
if (!afterFileSyncAction) {
195195
this.refreshApplication(deviceAppData, localToDevicePaths, isFullSync).wait();
196196
}
197-
device.fileSystem.putFile(this.$projectChangesService.getPrepareInfoFilePath(device.deviceInfo.platform), this.getLiveSyncInfoFilePath(deviceAppData)).wait();
197+
device.fileSystem.putFile(this.$projectChangesService.getPrepareInfoFilePath(device.deviceInfo.platform), this.getLiveSyncInfoFilePath(deviceAppData), this.liveSyncData.appIdentifier).wait();
198198
this.finishLivesync(deviceAppData).wait();
199199
if (afterFileSyncAction) {
200200
afterFileSyncAction(deviceAppData, localToDevicePaths).wait();
@@ -219,10 +219,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
219219
}
220220

221221
private getLiveSyncInfoFilePath(deviceAppData: Mobile.IDeviceAppData) {
222-
let deviceRootPath = deviceAppData.deviceProjectRootPath;
223-
if (deviceAppData.device.deviceInfo.platform.toLowerCase() === this.$devicePlatformsConstants.Android.toLowerCase()) {
224-
deviceRootPath = path.dirname(deviceRootPath);
225-
}
222+
let deviceRootPath = path.dirname(deviceAppData.deviceProjectRootPath);
226223
let deviceFilePath = path.join(deviceRootPath, livesyncInfoFileName);
227224
return deviceFilePath;
228225
}

lib/services/platform-service.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ export class PlatformService implements IPlatformService {
405405
if (!this.$options.release) {
406406
let deviceFilePath = this.getDeviceBuildInfoFilePath(device);
407407
let buildInfoFilePath = this.getBuildOutputPath(device.deviceInfo.platform, platformData, { buildForDevice: !device.isEmulator });
408-
device.fileSystem.putFile(path.join(buildInfoFilePath, buildInfoFileName), deviceFilePath).wait();
408+
let appIdentifier = this.$projectData.projectId;
409+
device.fileSystem.putFile(path.join(buildInfoFilePath, buildInfoFileName), deviceFilePath, appIdentifier).wait();
409410
}
410411
this.$logger.out(`Successfully installed on device with identifier '${device.deviceInfo.identifier}'.`);
411412
}).future<void>()();
@@ -494,10 +495,7 @@ export class PlatformService implements IPlatformService {
494495

495496
private getDeviceBuildInfoFilePath(device: Mobile.IDevice): string {
496497
let deviceAppData = this.$deviceAppDataFactory.create(this.$projectData.projectId, device.deviceInfo.platform, device);
497-
let deviceRootPath = deviceAppData.deviceProjectRootPath;
498-
if (device.deviceInfo.platform.toLowerCase() === this.$devicePlatformsConstants.Android.toLowerCase()) {
499-
deviceRootPath = path.dirname(deviceRootPath);
500-
}
498+
let deviceRootPath = path.dirname(deviceAppData.deviceProjectRootPath);
501499
return path.join(deviceRootPath, buildInfoFileName);
502500
}
503501

@@ -770,7 +768,7 @@ export class PlatformService implements IPlatformService {
770768
temp.track();
771769
let uniqueFilePath = temp.path({ suffix: ".tmp" });
772770
try {
773-
device.fileSystem.getFile(deviceFilePath, uniqueFilePath).wait();
771+
device.fileSystem.getFile(deviceFilePath, this.$projectData.projectId, uniqueFilePath).wait();
774772
} catch (e) {
775773
return null;
776774
}

0 commit comments

Comments
 (0)