Skip to content

Commit

Permalink
clean up & comment out backup
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanshelly committed Oct 22, 2020
1 parent a6d9ae5 commit 61c8cf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion infra/setup/bin/backup_file
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ source "$DOTFILES/infra/scripts/prompts.sh"
# - {string} [extension = bak] - extension of created file, default of bak
backup_file() {
# parameters
local src="$1" ext="$2"
local src="$1" ext="${2:-bak}"

[ -f "$src" ] && {
# TODO: conditionally use sudo here
sudo mv "$src" "$src.$ext"
}
}
Expand Down
4 changes: 2 additions & 2 deletions infra/setup/bin/setup_nix
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ maybe_install_nix_darwin() {

nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer

backup_default_system_files
# backup_default_system_files

# TODO: handle interactive prompts, pass flags to answer questions?
source "${TMPDIR}/result/bin/darwin-installer" || {
fail '`nix-darwin` installer failed. Please fix any issues and try again.'

restore_default_system_files
# restore_default_system_files

return 1
}
Expand Down

0 comments on commit 61c8cf5

Please sign in to comment.