Skip to content

Conversation

Plamen5kov
Copy link
Contributor

@Plamen5kov Plamen5kov commented Dec 1, 2017

When checking if files are changed we should ignore all files ending in .(something) as these files are hidden on mac and usually shouldn't be modified anyway.
This will make livesync work a bit faster when --sync-all-files flag is used, because there are a number of .(something) directories inside.

@Plamen5kov Plamen5kov self-assigned this Dec 1, 2017
@@ -219,6 +219,12 @@ export class ProjectChangesService implements IProjectChangesService {
}

private containsNewerFiles(dir: string, skipDir: string, projectData: IProjectData, processFunc?: (filePath: string, projectData: IProjectData) => boolean): boolean {

// ignore directories and files ending with .something (.bin, .git ...)
if (/.*[/\\]\.[^/\\]*$/.test(dir)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this code is correct I would prefer a non-regex approach. For example:

const dirName = path.basename(dir);
if (_.startsWith(dirName, '.')) {
    return false;
}

I think that a bit more readable.

@Plamen5kov Plamen5kov closed this Dec 4, 2017
@Plamen5kov Plamen5kov force-pushed the plamen5kov/ignore-hidden-files branch from c248136 to 0fe4a2b Compare December 4, 2017 07:38
@Plamen5kov Plamen5kov reopened this Dec 4, 2017
@Plamen5kov Plamen5kov merged commit 3dcf99d into master Dec 4, 2017
@Plamen5kov Plamen5kov deleted the plamen5kov/ignore-hidden-files branch December 4, 2017 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants