aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/install.sh
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-08-09 19:03:35 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-08-09 19:03:35 -0500
commit216479bfc9f1c22b5de2a591a1a86668429e2dea (patch)
tree8049e1fccaabcfac55f7c258d93294c00eb6d92f /install.sh
parent63c203ae784cd19c36cad23c02540645eb36c585 (diff)
fix: fix line ordering in stow output
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/install.sh b/install.sh
index 9d2d866..ac6d861 100755
--- a/install.sh
+++ b/install.sh
@@ -13,12 +13,12 @@ fi
printf "%s: Stowing packages\n" "$0"
# shellcheck disable=SC2086
stow -R "$@" ${1:-*}/ 2>&1 | awk '
- /^UNLINK:/ { stdout[$0] = 1; next }
- /\(reverts previous action\)$/ { delete stdout["UNLINK: " $2]; next }
- /^LINK:/ { stdout[$0] = 1; next }
+ /^UNLINK:/ { stdout[NR] = $0; unlinked[$2] = NR; next }
+ /\(reverts previous action\)$/ { delete stdout[unlinked[$2]]; next }
+ /^LINK:/ { stdout[NR] = $0; next }
{ stderr[NR] = $0 }
END {
- for (out in stdout) { print out };
+ for (out in stdout) { print stdout[out] };
for (err in stderr) { print stderr[err] > "/dev/stderr" }
if ( length(stderr) > 0 ) { exit 1 }
}