first commit
This commit is contained in:
commit
0610f4aeab
130 changed files with 9897 additions and 0 deletions
30
fn/-z4h-postinstall-systemd
Normal file
30
fn/-z4h-postinstall-systemd
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
eval "$_z4h_opt"
|
||||
|
||||
local comp=$Z4H_PACKAGE_DIR/shell-completion/zsh/_systemctl
|
||||
[[ -e $comp.in ]] || return 0
|
||||
[[ -v commands[systemd-path] ]] || return 0
|
||||
|
||||
local lib
|
||||
lib=$(systemd-path system-library-private) || return
|
||||
|
||||
if [[ $lib != /* ]]; then
|
||||
print -Pru2 -- '%F{3}z4h%f: unexpected command output: %F{1}systemd-path system-library-private%f'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -x /usr/lib/systemd/systemd ]]; then
|
||||
local systemd=/usr/lib/systemd
|
||||
elif [[ -x /lib/systemd/systemd ]]; then
|
||||
local systemd=/lib/systemd
|
||||
else
|
||||
print -Pru2 -- '%F{3}z4h%f: command not found: %F{1}systemd%f'
|
||||
return 1
|
||||
fi
|
||||
|
||||
local content
|
||||
content=$(<$comp.in)
|
||||
|
||||
print -r -- ${${content//@rootlibexecdir@/$systemd}//\\@/@} >$comp
|
||||
zf_rm -- $comp.in
|
Loading…
Add table
Add a link
Reference in a new issue