fix: ensure we don't try to remove unindexed undefined symlinks
This commit is contained in:
parent
d4c862824d
commit
54d284e597
3 changed files with 44 additions and 40 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@andyburke/fsdb",
|
"name": "@andyburke/fsdb",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./fsdb.ts",
|
".": "./fsdb.ts",
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,10 @@ export class FSDB_INDEXER_SYMLINKS<T> implements FSDB_INDEXER<T> {
|
||||||
const item_dir: string = path.dirname(item_path);
|
const item_dir: string = path.dirname(item_path);
|
||||||
|
|
||||||
for (const value of values) {
|
for (const value of values) {
|
||||||
|
if (typeof value === 'undefined') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const item_dir_reverse_link: string = path.join(item_dir, `.index.symlink.${this.config.name}.${sanitize(value)}`);
|
const item_dir_reverse_link: string = path.join(item_dir, `.index.symlink.${this.config.name}.${sanitize(value)}`);
|
||||||
if (!fs.existsSync(item_dir_reverse_link)) {
|
if (!fs.existsSync(item_dir_reverse_link)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue