Skip to content

Commit 8a7e798

Browse files
authored
skip the hidden files when livesyncing (#2663)
* Fix multiple mkdir commands for the same directory #2653 * skip the hidden files when livesyncing
1 parent 2f3878d commit 8a7e798

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,19 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
110110
}
111111
});
112112

113+
// skip hidden files, to prevent reload of the app for hidden files
114+
// created temporarily by the IDEs
115+
if (this.isUnixHiddenPath(filePath)) {
116+
isFileExcluded = true;
117+
}
118+
113119
return isFileExcluded;
114120
}
115121

122+
private isUnixHiddenPath(filePath: string): boolean {
123+
return (/(^|\/)\.[^\/\.]/g).test(filePath);
124+
}
125+
116126
private batchSync(filePath: string, dispatcher: IFutureDispatcher, afterFileSyncAction: (deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]) => Promise<void>, projectData: IProjectData): void {
117127
let platformBatch: ISyncBatch = this.batch[this.liveSyncData.platform];
118128
if (!platformBatch || !platformBatch.syncPending) {

0 commit comments

Comments
 (0)