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:
Jo-Philipp Wich 2022-10-25 12:50:37 +02:00
parent 639e7faa1a
commit adc4ca65bc

View file

@ -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;