zsh: openwrt-related goodies
listing archives with apk-tools 3.0.0_pre20250606 is PITA
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
!/.config/zsh/alias/k8s.zsh
|
||||
!/.config/zsh/alias/kconfig.zsh
|
||||
!/.config/zsh/alias/ls.zsh
|
||||
!/.config/zsh/alias/openwrt.zsh
|
||||
!/.config/zsh/alias/quilt.zsh
|
||||
!/.config/zsh/alias/sbuild.zsh
|
||||
!/.config/zsh/alias/sudo.zsh
|
||||
|
14
.config/zsh/alias/openwrt.zsh
Normal file
14
.config/zsh/alias/openwrt.zsh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/zsh
|
||||
|
||||
openwrt-apk-list() {
|
||||
local i w
|
||||
w=$(mktemp -d) ; : "${w:?}"
|
||||
for i ; do
|
||||
[ -n "$i" ] || continue
|
||||
find "$w/" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||
find "$w/" -mindepth 1 -maxdepth 1 -exec rm -rf {} + || return
|
||||
openwrt-apk extract --no-cache --no-logfile --no-network --no-check-certificate --allow-untrusted --no-chown --destination "$w" "$i"
|
||||
env -C "$w" find ./ -mindepth 1 -exec ls -ldgG --color {} +
|
||||
done
|
||||
rm -rf "$w"
|
||||
}
|
Reference in New Issue
Block a user