diff options
author | xyz <gky44px1999@gmail.com> | 2021-10-02 17:51:00 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-10-02 17:51:00 -0700 |
commit | 0c73a3432b7c6984ad81f9e3bdee711a6832f667 (patch) | |
tree | 279c5c9aabdb096f30c6eb25458183bbdb26668e | |
parent | 4872262c138f29526f911b32002f622f17a9377d (diff) |
refactor
-rwxr-xr-x | .local/bin/cpcfg | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/.local/bin/cpcfg b/.local/bin/cpcfg index 5e200ee0..083e2e41 100755 --- a/.local/bin/cpcfg +++ b/.local/bin/cpcfg @@ -1,6 +1,9 @@ #!/bin/sh # some dotfiles file permissions are different than normal root:root file, need chown +# If overwirte, cp by defualt uses `--no-preserve=all` which preserve target file mode, ownership, and timestamps. +# https://serverfault.com/questions/273949/cp-without-overwriting-destination-permissions/1048378#1048378 +# However, if no overwrite, we need chown if the target file mode we want is different from normal root:root 644 file. sudo cp -i -- "$XDG_CONFIG_HOME/myconf/pacman.conf" /etc/ sudo cp -i -- "$XDG_CONFIG_HOME/myconf/locale.gen" /etc/ sudo mkdir -p /etc/wildmidi/ |