fix ignore logic
This commit is contained in:
parent
421b43d937
commit
36d3018efb
@ -202,16 +202,19 @@ export const checkIsSkipItemOrNotByName = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isInsideObsFolder(key, configDir) && finalIsIgnored === undefined) {
|
|
||||||
if (syncConfigDir) {
|
// we have to check bookmarks.json firstly then check the whole .obsidian folder later
|
||||||
|
if (isBookmarksFile(key, configDir) && finalIsIgnored === undefined) {
|
||||||
|
if (syncBookmarks) {
|
||||||
finalIsIgnored = false;
|
finalIsIgnored = false;
|
||||||
} else {
|
} else {
|
||||||
finalIsIgnored = true;
|
finalIsIgnored = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBookmarksFile(key, configDir) && finalIsIgnored === undefined) {
|
// we have to check bookmarks.json firstly then check the whole .obsidian folder later
|
||||||
if (syncBookmarks) {
|
if (isInsideObsFolder(key, configDir) && finalIsIgnored === undefined) {
|
||||||
|
if (syncConfigDir) {
|
||||||
finalIsIgnored = false;
|
finalIsIgnored = false;
|
||||||
} else {
|
} else {
|
||||||
finalIsIgnored = true;
|
finalIsIgnored = true;
|
||||||
@ -260,17 +263,9 @@ export const checkIsSkipItemOrNotByName = (
|
|||||||
* | yes, also apply to children | explictly ignored | yes | yes | yes |
|
* | yes, also apply to children | explictly ignored | yes | yes | yes |
|
||||||
*/
|
*/
|
||||||
export const getSkipItemsByList = (
|
export const getSkipItemsByList = (
|
||||||
skipOrNotResults: Record<string, IsSkipResult>,
|
skipOrNotResults: Record<string, IsSkipResult>
|
||||||
ignorePaths: string[],
|
|
||||||
onlyAllowPaths: string[]
|
|
||||||
): string[] => {
|
): string[] => {
|
||||||
const allPotentialKeys = Object.keys(skipOrNotResults);
|
const allPotentialKeys = Object.keys(skipOrNotResults);
|
||||||
if (
|
|
||||||
allPotentialKeys.length === 0 ||
|
|
||||||
(ignorePaths.length === 0 && onlyAllowPaths.length === 0)
|
|
||||||
) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// from short(shadow) to long(deep) , ascending
|
// from short(shadow) to long(deep) , ascending
|
||||||
const sortedKeys = allPotentialKeys.sort((k1, k2) => k1.length - k2.length);
|
const sortedKeys = allPotentialKeys.sort((k1, k2) => k1.length - k2.length);
|
||||||
@ -333,6 +328,7 @@ export const getSkipItemsByList = (
|
|||||||
result.push(key);
|
result.push(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.debug(`finalIsIgnored list= ${JSON.stringify(result)}`);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -499,11 +495,7 @@ const ensembleMixedEnties = async (
|
|||||||
profiler?.insertSize("sizeof finalMappings", finalMappings);
|
profiler?.insertSize("sizeof finalMappings", finalMappings);
|
||||||
|
|
||||||
// we check the skipOrNotResults again! in case we adjust some paths!
|
// we check the skipOrNotResults again! in case we adjust some paths!
|
||||||
const allReallySkipKeys = getSkipItemsByList(
|
const allReallySkipKeys = getSkipItemsByList(skipOrNotResults);
|
||||||
skipOrNotResults,
|
|
||||||
ignorePaths,
|
|
||||||
onlyAllowPaths
|
|
||||||
);
|
|
||||||
for (const key of allReallySkipKeys) {
|
for (const key of allReallySkipKeys) {
|
||||||
delete finalMappings[key];
|
delete finalMappings[key];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user