Add GLOB support to oputil fb scan...

This commit is contained in:
Bryan Ashby 2018-03-10 11:37:23 -07:00
parent f6f1de4bd8
commit 9c87d45433
3 changed files with 32 additions and 2 deletions

View file

@ -15,6 +15,7 @@ exports.getDefaultConfigPath = getDefaultConfigPath;
exports.getConfigPath = getConfigPath;
exports.initConfigAndDatabases = initConfigAndDatabases;
exports.getAreaAndStorage = getAreaAndStorage;
exports.looksLikePattern = looksLikePattern;
const exitCodes = exports.ExitCodes = {
SUCCESS : 0,
@ -87,4 +88,13 @@ function getAreaAndStorage(tags) {
}
return entry;
});
}
function looksLikePattern(tag) {
// globs can start with @
if(tag.indexOf('@') > 0) {
return false;
}
return /[*?[\]!()+|^]/.test(tag);
}