-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:dther/dotfiles
- Loading branch information
Showing
3 changed files
with
37 additions
and
8 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
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 |
---|---|---|
@@ -1,14 +1,32 @@ | ||
#!/bin/sh | ||
|
||
# Initialise home directory the way I like it. | ||
# Installs configuration and creates the necessary XDG directories | ||
# (e.g. Pictures, Documents, but named the way I like them) | ||
|
||
git clone --bare [email protected]:dther/dotfiles.git "$HOME/.myconf" | ||
alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME' | ||
config config status.showUntrackedFiles no | ||
|
||
if config checkout; then | ||
printf "%s\n" "Dotfiles installed successfully." | ||
printf "%s\n%s\n" "Dotfiles installed successfully." \ | ||
"Making XDG directories..." | ||
while read -r dir; do | ||
dir=${dir%%#*} | ||
[ -z "$dir" ] && continue | ||
dir=${dir#*\"} | ||
dir=${dir%%\"*} | ||
# simulate xdg-user-dir's "shell expansion" (it doesn't really) | ||
dir=$(printf "%s" "$dir" | sed "s|\$HOME|$HOME|g") | ||
printf "Making %s...\n" "$dir" | ||
mkdir "$dir" | ||
done < "$HOME/.config/user-dirs.dirs" | ||
printf "%s\n" \ | ||
"That should have been mostly painless. | ||
Run 'xdg-user-dirs-update' to finish up. | ||
(This allows userspace programs to know where your folders are...)" | ||
exit 0 | ||
fi; | ||
|
||
printf "Failed to install dotfiles! Please check/backup the following files:\n" | ||
config checkout | ||
printf "and try again.\n" | ||
printf "Failed to install dotfiles! Please check/backup your files and try again." | ||
exit 1 |