This message was deleted.
# puppet
s
This message was deleted.
s
You can use the
join
built-in for that:
$joined_folders = $folders.join('-d ')
b
huh
let me try
The result is
/bar-d /foo
, since -d is used as a separator, so it is not present before the first folder
I could do "-d " + $folders.join(' -d '), but sometimes folders array is empty:)
and it's not really nice looking:)
s
then join
or in stdlib there is the prefix() function
still need to join at the end
s
Good to know, I'd probably just do the string concatenation but it does look a little ugly
b
thank you both, I'll have a look at it
$watch_dirs.map |$x| { "-d ${x}" }.join(' ')
👍 1
this produces the correct result
👍🏼 1