-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move dotfiles remote setup to separate file
- Loading branch information
Showing
3 changed files
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# Make your machine usable | ||
# | ||
# Usage: set_dotfiles_remote | ||
|
||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
declare dotfiles_root | ||
dotfiles_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
|
||
set_dotfiles_remote() { | ||
( | ||
cd "${dotfiles_root}" | ||
if git remote get-url "$(git remote)" | grep -q https; then | ||
echo "Setting dotfiles git remote" | ||
git remote set-url origin [email protected]:fortes/dotfiles.git | ||
fi | ||
) | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
set_dotfiles_remote "${@}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,16 +107,6 @@ set_default_applications() { | |
fi | ||
} | ||
|
||
set_dotfiles_remote() { | ||
( | ||
cd "${dotfiles_root}" | ||
if git remote get-url "$(git remote)" | grep -q https; then | ||
echo "Setting dotfiles git remote" | ||
git remote set-url origin [email protected]:fortes/dotfiles.git | ||
fi | ||
) | ||
} | ||
|
||
setup_backports() { | ||
declare -r codename="$(lsb_release -cs | tail -n 1)" | ||
|
||
|
@@ -259,7 +249,7 @@ main() { | |
|
||
check_prerequisites | ||
setup_shell | ||
set_dotfiles_remote | ||
"${dotfiles_root}/scripts/set_dotfiles_remote" | ||
|
||
if [[ ! -f "${local_profile_path}" ]]; then | ||
echo "Generating ${local_profile_path}" | ||
|