@@ -64,7 +64,7 @@ export abstract class PlatformLiveSyncServiceBase {
64
64
const mappedFiles = _ . map ( filesToSync , filePath => this . $projectFilesProvider . mapFilePath ( filePath , device . deviceInfo . platform , projectData ) ) ;
65
65
66
66
// Some plugins modify platforms dir on afterPrepare (check nativescript-dev-sass) - we want to sync only existing file.
67
- const existingFiles = mappedFiles . filter ( m => this . $fs . exists ( m ) ) ;
67
+ const existingFiles = mappedFiles . filter ( m => m && this . $fs . exists ( m ) ) ;
68
68
this . $logger . trace ( "Will execute livesync for files: " , existingFiles ) ;
69
69
const skippedFiles = _ . difference ( mappedFiles , existingFiles ) ;
70
70
if ( skippedFiles . length ) {
@@ -75,7 +75,7 @@ export abstract class PlatformLiveSyncServiceBase {
75
75
const platformData = this . $platformsData . getPlatformData ( device . deviceInfo . platform , projectData ) ;
76
76
const projectFilesPath = path . join ( platformData . appDestinationDirectoryPath , APP_FOLDER_NAME ) ;
77
77
const localToDevicePaths = await this . $projectFilesManager . createLocalToDevicePaths ( deviceAppData ,
78
- projectFilesPath , mappedFiles , [ ] ) ;
78
+ projectFilesPath , existingFiles , [ ] ) ;
79
79
modifiedLocalToDevicePaths . push ( ...localToDevicePaths ) ;
80
80
await this . transferFiles ( deviceAppData , localToDevicePaths , projectFilesPath , false ) ;
81
81
}
@@ -85,7 +85,10 @@ export abstract class PlatformLiveSyncServiceBase {
85
85
const filePaths = liveSyncInfo . filesToRemove ;
86
86
const platformData = this . $platformsData . getPlatformData ( device . deviceInfo . platform , projectData ) ;
87
87
88
- const mappedFiles = _ . map ( filePaths , filePath => this . $projectFilesProvider . mapFilePath ( filePath , device . deviceInfo . platform , projectData ) ) ;
88
+ const mappedFiles = _ ( filePaths )
89
+ . map ( filePath => this . $projectFilesProvider . mapFilePath ( filePath , device . deviceInfo . platform , projectData ) )
90
+ . filter ( filePath => ! ! filePath )
91
+ . value ( ) ;
89
92
const projectFilesPath = path . join ( platformData . appDestinationDirectoryPath , APP_FOLDER_NAME ) ;
90
93
const localToDevicePaths = await this . $projectFilesManager . createLocalToDevicePaths ( deviceAppData , projectFilesPath , mappedFiles , [ ] ) ;
91
94
modifiedLocalToDevicePaths . push ( ...localToDevicePaths ) ;
0 commit comments