I have the following logic:
If file in variable f is a symlink, resolve it
and use the result as link target.
Otherwise, use the result as link target directly.

So I’d like to have an ifthenelse and return the
same envvar from both branches. But this is the
best I can do:

ifte {
  backtick res { s6-linkname -f $f }
  importas -ui res res
  s6-ln $res $origin
} {
  s6-ln $f $origin
{ s6-test -L $f } 

My hope would be something like:

ifthenelse { s6-test -L $f } {
  return $res somehow
} {}
s6-ln $res $origin

Written with Emacs (mu4e) on NixOS.
Q: Why is this email five sentences or less?
A: http://five.sentenc.es/
May take up to five days to read your message. If it’s urgent, call me.

Reply via email to