package.nu: provisioner actions
056a6cd6a5e50240fa4731ae06236b88e4a312c2
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 1e162916cebb
bugabingas dorkfiles
056a6cd6a5e50240fa4731ae06236b88e4a312c2
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+46 / −13 text lines
+10 / −1 text lines
# run-external tar '--extract' $"--($type)" $"--file=($archive)" $"--directory=($target)" '--strip-components=1' let is_single_dir = (run-external tar '--list' $'--file=($archive)' | lines | path split | first | uniq | length) == 1 print $'Unpacking ($archive) into ($target) with strip ($strip)'+8 / −4 text lines
+28 / −8 text lines
let manifests = ls | get name | str replace '.nuon' '' | wrap manifest let provisions = open **/*.nuon | uniq let provisions = open **/*.nuon | uniq | wrap manifest | upsert action install let actions = $provisions | merge deep --strategy append $manifests | uniq-by manifest $actions | each { |item| match $item.action { 'install' => { print $'Installing ($item.manifest)' installer install $item.manifest } 'uninstall' => { print $'Uninstalling ($item.manifest)' # installer uninstall $item.manifest } } }