When using __link to create a symbolic link with a non-existing --source (e.g. one being created by a cron job), the type explorer will always (incorrectly) report none, making the type recreate the symbolic link on every run.
This is because test ! -e returns 0 for a symbolic link whose link destination does not exist. So to fix the behaviour, we test -h first, detecting it is a symbolic link.
I also did a little simplification in the state explorer: we don't need to cd in the --type symbolic case, because the sources are compared as strings, not as actual file system paths.
When using
__link
to create a symbolic link with a non-existing--source
(e.g. one being created by a cron job), thetype
explorer will always (incorrectly) reportnone
, making the type recreate the symbolic link on every run.This is because
test ! -e
returns0
for a symbolic link whose link destination does not exist. So to fix the behaviour, wetest -h
first, detecting it is a symbolic link.I also did a little simplification in the
state
explorer: we don't need tocd
in the--type symbolic
case, because the sources are compared as strings, not as actual file system paths.