diff options
author | Levin Winter <33220502+levinwinter@users.noreply.github.com> | 2023-01-26 02:57:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-26 02:57:31 +0300 |
commit | fbdc4556d519512736a8e2abfb3e03fcb2c9e0c7 (patch) | |
tree | 14c419b8b7a1c9dc0f389666fb6d44db17472866 | |
parent | 258d5029a58e35d62c9d39400c92b41ed90825ee (diff) |
[common-utils] Fix nonempty .bashrc being restored (#421)
* [common-utils] Fix nonempty .bashrc being restored
The user's dotfiles shall only be restored to their defaults if they do
not exist or are empty. A missing negation caused the files to be
overwritten even when they were nonempty.
* [common-utils] Bump patch version after fix
Go from 2.0.7 to 2.0.8 because of backwards-compatible fix.
-rw-r--r-- | src/common-utils/main.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index c8541cd..2a8cd28 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -393,7 +393,7 @@ fi possible_rc_files=( ".bashrc" ".profile" ".zshrc" ) for rc_file in "${possible_rc_files[@]}"; do if [ -f "/etc/skel/${rc_file}" ]; then - if [ ! -e "${user_rc_path}/${rc_file}" ] || [ -s "${user_rc_path}/${rc_file}" ]; then + if [ ! -e "${user_rc_path}/${rc_file}" ] || [ ! -s "${user_rc_path}/${rc_file}" ]; then cp "/etc/skel/${rc_file}" "${user_rc_path}/${rc_file}" chown ${USERNAME}:${group_name} "${user_rc_path}/${rc_file}" fi |