diff --git a/lib/common b/lib/common index b218c1863f..604a1ddccd 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit b218c1863fa7ba76d05db3642ee26c5f27ed760d +Subproject commit 604a1ddccd6e3bcc3e8beb4dee0d658e99bc2bdd diff --git a/lib/services/livesync/platform-livesync-service-base.ts b/lib/services/livesync/platform-livesync-service-base.ts index 298d34c902..bb25daf456 100644 --- a/lib/services/livesync/platform-livesync-service-base.ts +++ b/lib/services/livesync/platform-livesync-service-base.ts @@ -64,7 +64,7 @@ export abstract class PlatformLiveSyncServiceBase { const mappedFiles = _.map(filesToSync, filePath => this.$projectFilesProvider.mapFilePath(filePath, device.deviceInfo.platform, projectData)); // Some plugins modify platforms dir on afterPrepare (check nativescript-dev-sass) - we want to sync only existing file. - const existingFiles = mappedFiles.filter(m => this.$fs.exists(m)); + const existingFiles = mappedFiles.filter(m => m && this.$fs.exists(m)); this.$logger.trace("Will execute livesync for files: ", existingFiles); const skippedFiles = _.difference(mappedFiles, existingFiles); if (skippedFiles.length) { @@ -75,7 +75,7 @@ export abstract class PlatformLiveSyncServiceBase { const platformData = this.$platformsData.getPlatformData(device.deviceInfo.platform, projectData); const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, APP_FOLDER_NAME); const localToDevicePaths = await this.$projectFilesManager.createLocalToDevicePaths(deviceAppData, - projectFilesPath, mappedFiles, []); + projectFilesPath, existingFiles, []); modifiedLocalToDevicePaths.push(...localToDevicePaths); await this.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, false); } @@ -85,7 +85,10 @@ export abstract class PlatformLiveSyncServiceBase { const filePaths = liveSyncInfo.filesToRemove; const platformData = this.$platformsData.getPlatformData(device.deviceInfo.platform, projectData); - const mappedFiles = _.map(filePaths, filePath => this.$projectFilesProvider.mapFilePath(filePath, device.deviceInfo.platform, projectData)); + const mappedFiles = _(filePaths) + .map(filePath => this.$projectFilesProvider.mapFilePath(filePath, device.deviceInfo.platform, projectData)) + .filter(filePath => !!filePath) + .value(); const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, APP_FOLDER_NAME); const localToDevicePaths = await this.$projectFilesManager.createLocalToDevicePaths(deviceAppData, projectFilesPath, mappedFiles, []); modifiedLocalToDevicePaths.push(...localToDevicePaths);