1
0
mirror of https://github.com/kremalicious/dotfiles.git synced 2024-11-21 17:27:13 +01:00

renaming & refactor

This commit is contained in:
Matthias Kretschmann 2017-09-10 14:40:28 +02:00
parent 6a5f3c8093
commit 1faaa176b7
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 37 additions and 45 deletions

View File

@ -9,15 +9,16 @@
# https://github.com/rtomayko/dotfiles # https://github.com/rtomayko/dotfiles
######################################################################## ########################################################################
# shellcheck source=/dev/null
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Load ~/.private, ~/.bash_prompt # Load ~/.private, ~/.bash_prompt
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
for file in ~/.{exports,private,bash_paths,bash_prompt,aliases,inputrc}; do for FILE in ~/.{bash_exports,bash_paths,bash_prompt,bash_aliases,private,inputrc}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file" [ -r "$FILE" ] && [ -f "$FILE" ] && source "$FILE"
done; done;
unset file; unset FILE;
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# SHELL OPTIONS # SHELL OPTIONS

1
bashrc
View File

@ -1,3 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck source=/dev/null
[ -n "$PS1" ] && source ~/.bash_profile; [ -n "$PS1" ] && source ~/.bash_profile;

View File

@ -9,15 +9,8 @@
set e set e
# ----------------------------------------------------------------------
# Variables
# ----------------------------------------------------------------------
# dotfiles directory
cd ../ || exit
# list of files/folders to symlink in homedir # list of files/folders to symlink in homedir
files="aliases bashrc bash_profile bash_paths bash_prompt exports gemrc gitconfig gitignore hushlogin inputrc private npmrc bin tmux.conf" FILES="bash_aliases bashrc bash_profile bash_paths bash_prompt bash_exports gemrc gitconfig gitignore hushlogin inputrc private npmrc bin tmux.conf"
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# create the private file first, will be symlinked but ignored by git # create the private file first, will be symlinked but ignored by git
@ -27,19 +20,29 @@ touch private
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# create symlinks from the homedir to any files in the dotfiles directory # create symlinks from the homedir to any files in the dotfiles directory
# specified in $files # specified in $FILES
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
for file in $files; do for FILE in $FILES; do
ln -s "$file" ~/."$file"
echo "$(tput setaf 64)$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)" # remove old symlinks if present
if [ -h "$HOME/.$FILE" ]; then
rm "$HOME/.$FILE"
echo "$(tput setaf 64)$(tput sgr0) Removed old symlink to $(tput setaf 37)$FILE$(tput sgr0)"
fi
# symlink files
ln -s "$PWD/$FILE" "$HOME/.$FILE"
echo "$(tput setaf 64)$(tput sgr0) Created new symlink to $(tput setaf 37)$FILE$(tput sgr0)"
done done
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# source what we just created # source what we just created
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
source ~/.bash_profile # shellcheck source=/dev/null
source "$HOME/.bash_profile"
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Homebrew # Homebrew
@ -49,7 +52,7 @@ echo "$(tput setaf 136) Brewing all the things. "
echo "=============================================$(tput sgr0)" echo "=============================================$(tput sgr0)"
"" # reset "" # reset
bin/install-brew.sh ./bin/install-brew.sh
echo "$(tput setaf 64)---------------------------------------------" echo "$(tput setaf 64)---------------------------------------------"
echo " ✓ done$(tput sgr0)" echo " ✓ done$(tput sgr0)"
@ -60,7 +63,7 @@ echo " ✓ done$(tput sgr0)"
echo "$(tput setaf 136) npm all the things. " echo "$(tput setaf 136) npm all the things. "
echo "=============================================$(tput sgr0)" echo "=============================================$(tput sgr0)"
bin/install-npm.sh ./bin/install-npm.sh
echo "$(tput setaf 64)---------------------------------------------" echo "$(tput setaf 64)---------------------------------------------"
echo " ✓ done$(tput sgr0)" echo " ✓ done$(tput sgr0)"
@ -72,7 +75,7 @@ echo " ✓ done$(tput sgr0)"
echo "$(tput setaf 136) Ruby all the things. " echo "$(tput setaf 136) Ruby all the things. "
echo "=============================================$(tput sgr0)" echo "=============================================$(tput sgr0)"
bin/install-ruby.sh ./bin/install-ruby.sh
echo "$(tput setaf 64)---------------------------------------------" echo "$(tput setaf 64)---------------------------------------------"
echo " ✓ done$(tput sgr0)" echo " ✓ done$(tput sgr0)"

View File

@ -7,41 +7,28 @@
# https://github.com/michaeljsmalley/dotfiles/blob/master/makesymlinks.sh # https://github.com/michaeljsmalley/dotfiles/blob/master/makesymlinks.sh
######################################################################## ########################################################################
# ----------------------------------------------------------------------
# Variables
# ----------------------------------------------------------------------
# dotfiles directory
cd ../ || exit
# list of files/folders to symlink in homedir # list of files/folders to symlink in homedir
files="aliases bashrc bash_profile bash_paths bash_prompt editorconfig exports gemrc gitconfig gitignore hushlogin inputrc private npmrc bin tmux.conf" FILES="bash_aliases bashrc bash_profile bash_paths bash_prompt bash_exports editorconfig gemrc gitconfig gitignore hushlogin inputrc private npmrc bin tmux.conf"
for FILE in $FILES; do
# ---------------------------------------------------------------------- # remove old symlinks if present
# delete existing dotfiles in ~ if [ -h "$HOME/.$FILE" ]; then
# ---------------------------------------------------------------------- rm "$HOME/.$FILE"
echo "$(tput setaf 64)$(tput sgr0) Removed old symlink to $(tput setaf 37)$FILE$(tput sgr0)"
fi
# symlink files
ln -s "$PWD/$FILE" "$HOME/.$FILE"
echo "$(tput setaf 64)$(tput sgr0) Created new symlink to $(tput setaf 37)$FILE$(tput sgr0)"
for file in $files; do
rm ~/."$file"
done done
# ----------------------------------------------------------------------
# create symlinks from the homedir to any files in the ~/dotfiles directory
# specified in $files
# ----------------------------------------------------------------------
for file in $files; do
ln -s "$file" ~/."$file"
echo "$(tput setaf 64)$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
done
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# source what we just created # source what we just created
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
source ~/.bash_profile # shellcheck source=/dev/null
source "$HOME/.bash_profile"
exit exit