Skip to content

Commit

Permalink
fix(frontend): exclude .git by default (GoogleChromeLabs#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkozy authored Jul 30, 2018
1 parent f947569 commit 3df125d
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion front_end/ndb/NdbMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ Ndb.NdbMain = class extends Common.Object {
.then(this._startRepl.bind(this));
}

static _defaultExcludePattern() {
const defaultCommonExcludedFolders = [
'/bower_components/', '/\\.devtools', '/\\.git/', '/\\.sass-cache/', '/\\.hg/', '/\\.idea/',
'/\\.svn/', '/\\.cache/', '/\\.project/'
];
const defaultWinExcludedFolders = ['/Thumbs.db$', '/ehthumbs.db$', '/Desktop.ini$', '/\\$RECYCLE.BIN/'];
const defaultMacExcludedFolders = [
'/\\.DS_Store$', '/\\.Trashes$', '/\\.Spotlight-V100$', '/\\.AppleDouble$', '/\\.LSOverride$', '/Icon$',
'/\\._.*$'
];
const defaultLinuxExcludedFolders = ['/.*~$'];
let defaultExcludedFolders = defaultCommonExcludedFolders;
if (Host.isWin())
defaultExcludedFolders = defaultExcludedFolders.concat(defaultWinExcludedFolders);
else if (Host.isMac())
defaultExcludedFolders = defaultExcludedFolders.concat(defaultMacExcludedFolders);
else
defaultExcludedFolders = defaultExcludedFolders.concat(defaultLinuxExcludedFolders);
return defaultExcludedFolders;
}

static _calculateBlackboxState() {
const whitelistOnlyProject = Common.moduleSetting('blackboxAnythingOutsideCwd').get();
const whitelistModules = Common.moduleSetting('whitelistedModules').get().split(',');
Expand Down Expand Up @@ -69,7 +90,7 @@ Ndb.NdbMain = class extends Common.Object {
excludePattern = '^/[^/]+/[^/]+/[^/]+/';
}
const setting = Persistence.isolatedFileSystemManager.workspaceFolderExcludePatternSetting();
setting.set(excludePattern);
setting.set([excludePattern, ...Ndb.NdbMain._defaultExcludePattern()].join('|'));
setExcludedPattern(excludePattern);

function populateFolders(folders, currentRoot) {
Expand Down

0 comments on commit 3df125d

Please sign in to comment.