luci-base: dispatcher.uc: reintroduce support for 'absent' fs depends
The ability to require certain paths to be absent for a menu entry to show up was lost during the ucode conversion. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
639e7faa1a
commit
adc4ca65bc
1 changed files with 4 additions and 0 deletions
|
@ -183,6 +183,10 @@ function check_fs_depends(spec) {
|
||||||
if (fstat?.type != 'file')
|
if (fstat?.type != 'file')
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if (kind == 'absent') {
|
||||||
|
if (stat(path) != null)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue