mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
shortcuts: fix file removal - do not remove /dev/null
as a non-root user, this would be fine. but, i was setting up a docker container for development [1], and upon running a login shell, the shortcuts script would get invoked, and would remove /dev/null (and later re-create it), which changes its type from a character device into a regular file, thus breaking the system (e.g. apt update wouldn't work anymore). [1] https://github.com/kiprasmel/infra/blob/master/local/devel-core-git/Dockerfile
This commit is contained in:
parent
7a96fb100c
commit
f36e40f3d7
@ -14,7 +14,10 @@ fish_shortcuts="/dev/null"
|
|||||||
vifm_shortcuts="/dev/null"
|
vifm_shortcuts="/dev/null"
|
||||||
|
|
||||||
# Remove, prepare files
|
# Remove, prepare files
|
||||||
rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null
|
for file in "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts"; do
|
||||||
|
test -f "$file" && rm -f "$file" 2>/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
|
||||||
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
|
||||||
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user