Refactor some stuff.
This commit is contained in:
parent
94c3a79793
commit
0ee8ce71af
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
cd $BASH_SOURCE && source dotfiles/lib/shellrc/aliases.sh && source dotfiles/lib/bash/aliases.sh
|
cd `dirname $BASH_SOURCE` && source bootstrapping.sh
|
||||||
DOTFILES_DIRECTORY="(sourcefile_abspath)/dotfiles"
|
DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles"
|
||||||
echo $DOTFILES_DIRECTORY
|
echo $DOTFILES_DIRECTORY
|
||||||
|
|
||||||
function symlink_dotfiles() {
|
function symlink_dotfiles() {
|
||||||
@ -33,11 +33,9 @@ function parse_options() {
|
|||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
read -p "Symlinking files from $DOTFILES_DIRECTORY. This may overwrite existing files in your home directory. Do you wish to proceed? (y/n) " -n 1
|
read -p "Symlinking files from $DOTFILES_DIRECTORY. This may overwrite existing files in your home directory. Do you wish to proceed? (y/n) " -n 1
|
||||||
echo
|
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
symlink_dotfiles
|
symlink_dotfiles
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_options()
|
parse_options
|
||||||
|
5
bootstrapping.sh
Normal file
5
bootstrapping.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
readlink_command='readlink'
|
||||||
|
command -v greadlink > /dev/null && readlink_command="greadlink"
|
||||||
|
function dotfiles_abspath() {
|
||||||
|
echo "$(${readlink_command} -f "$BASH_SOURCE" | xargs dirname)"
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
Subproject commit e2f272b4e1b9969ffeadb5ffa1f764674066f558
|
Subproject commit 32aa532c7e076a843c21d621d496265e03f028b3
|
@ -1 +0,0 @@
|
|||||||
alias sourcefile_abspath='$(readlink -f "$BASH_SOURCE" | xargs dirname)'
|
|
@ -19,16 +19,16 @@ function current_directory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function git_prompt_info() {
|
function git_prompt_info() {
|
||||||
if test -z $(parse_git_branch);
|
if test -z $(git branch-or-sha);
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
echo " on $(parse_git_branch)$(git_status_character)"
|
echo " on $(git branch-or-sha)$(git_status_character)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function git_status_character() {
|
function git_status_character() {
|
||||||
if git_is_dirty;
|
if git dirty;
|
||||||
then
|
then
|
||||||
echo "✘"
|
echo "✘"
|
||||||
else
|
else
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
alias emacs="emacsclient -t"
|
alias emacs="emacsclient -t"
|
||||||
alias tmux="tmux -2"
|
alias tmux="tmux -2"
|
||||||
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'
|
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'
|
||||||
@ -6,7 +7,6 @@ alias go2dotfiles='cd $(dirname `readlink -f ~/.zshrc | xargs dirname`)'
|
|||||||
|
|
||||||
# enables the sudoing of aliases.
|
# enables the sudoing of aliases.
|
||||||
alias sudo='sudo '
|
alias sudo='sudo '
|
||||||
alias get_absolute_directory=
|
|
||||||
|
|
||||||
# Detect which `ls` flavor is in use
|
# Detect which `ls` flavor is in use
|
||||||
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
||||||
|
22
setup.sh
22
setup.sh
@ -1,14 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
case `uname` in
|
cd `dirname $BASH_SOURCE` && source bootstrapping.sh
|
||||||
'Darwin')
|
|
||||||
readlink_command='greadlink'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
readlink_command='readlink'
|
|
||||||
esac
|
|
||||||
DOTFILES_DIRECTORY="$(dirname "${BASH_SOURCE}" | xargs ${readlink_command} -f)"
|
|
||||||
cd $DOTFILES_DIRECTORY
|
|
||||||
|
|
||||||
case `uname` in
|
case `uname` in
|
||||||
'Darwin')
|
'Darwin')
|
||||||
source resources/osx.sh
|
source resources/osx.sh
|
||||||
@ -19,13 +10,4 @@ case `uname` in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
function install_python_packages() {
|
|
||||||
sudo -v
|
|
||||||
source ~/.path
|
|
||||||
easy_install pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo "Installing Dot Files."
|
|
||||||
source bootstrap.sh
|
source bootstrap.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user