Skip to content

skip the hidden files when livesyncing #2663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/services/livesync/platform-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,19 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
}
});

// skip hidden files, to prevent reload of the app for hidden files
// created temporarily by the IDEs
if (this.isUnixHiddenPath(filePath)) {
isFileExcluded = true;
}

return isFileExcluded;
}

private isUnixHiddenPath(filePath: string): boolean {
return (/(^|\/)\.[^\/\.]/g).test(filePath);
}

private batchSync(filePath: string, dispatcher: IFutureDispatcher, afterFileSyncAction: (deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]) => Promise<void>, projectData: IProjectData): void {
let platformBatch: ISyncBatch = this.batch[this.liveSyncData.platform];
if (!platformBatch || !platformBatch.syncPending) {
Expand Down