Merge pull request #15 from aarmea/u/aarmea/fix/no-clobber-config
Don't clober user configs on install
This commit is contained in:
commit
3453e656a5
1 changed files with 10 additions and 6 deletions
|
|
@ -159,12 +159,16 @@ install_config() {
|
||||||
maybe_sudo chown "$user:$user" "$user_config_dir"
|
maybe_sudo chown "$user:$user" "$user_config_dir"
|
||||||
maybe_sudo chmod 0755 "$user_config_dir"
|
maybe_sudo chmod 0755 "$user_config_dir"
|
||||||
|
|
||||||
|
# Check if config already exists
|
||||||
|
if maybe_sudo test -f "$dst_config"; then
|
||||||
|
warn "Config file already exists at $dst_config, skipping"
|
||||||
|
else
|
||||||
# Copy config file
|
# Copy config file
|
||||||
maybe_sudo cp "$source_config" "$dst_config"
|
maybe_sudo cp "$source_config" "$dst_config"
|
||||||
maybe_sudo chown "$user:$user" "$dst_config"
|
maybe_sudo chown "$user:$user" "$dst_config"
|
||||||
maybe_sudo chmod 0644 "$dst_config"
|
maybe_sudo chmod 0644 "$dst_config"
|
||||||
|
|
||||||
success "Installed user configuration for $user"
|
success "Installed user configuration for $user"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install everything
|
# Install everything
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue