mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
No backup if user config doesn't already exist
This commit is contained in:
@@ -20,6 +20,7 @@ user_config_file="${HOME}/.config/$config_file"
|
||||
default_config_file="${HOME}/.local/share/omarchy/config/$config_file"
|
||||
backup_config_file="$user_config_file.bak.$(date +%s)"
|
||||
|
||||
if [[ -f "$user_config_file" ]]; then
|
||||
# Create preliminary backup
|
||||
cp -f "$user_config_file" "$backup_config_file" 2>/dev/null
|
||||
|
||||
@@ -33,3 +34,7 @@ else
|
||||
echo -e "\e[31mReplaced $user_config_file with new Omarchy default.\nSaved backup as ${backup_config_file}.\n\n\e[32mChanges:\e[0m"
|
||||
diff "$user_config_file" "$backup_config_file"
|
||||
fi
|
||||
else
|
||||
# Config file did not exist already
|
||||
cp -f "$default_config_file" "$user_config_file" 2>/dev/null
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user