[Shell] Remove tabs in functions.sh

This commit is contained in:
Ivan Malison 2016-11-24 17:16:29 -08:00
parent b7afda3c4c
commit 29ca0267bc
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -8,7 +8,7 @@ function path_lines {
# pyenv alters PATH before actually executing python, which ends # pyenv alters PATH before actually executing python, which ends
# up changing PATH in a way that is not desireable. # up changing PATH in a way that is not desireable.
hash pyenv 2>/dev/null && python_command="$(pyenv which python)" || python_command="$(which python)" hash pyenv 2>/dev/null && python_command="$(pyenv which python)" || python_command="$(which python)"
"$python_command" "$HOME/.lib/python/shell_path.py" --path-lines "$@" "$python_command" "$HOME/.lib/python/shell_path.py" --path-lines "$@"
} }
function indirect_expand { function indirect_expand {
@ -44,7 +44,7 @@ function echo_split () {
$1 $1
EOF EOF
for i in "${arr[@]}"; do for i in "${arr[@]}"; do
echo $i echo $i
done done
} }
@ -76,7 +76,7 @@ function current_shell() {
} }
function is_zsh() { function is_zsh() {
[ ! -z ${ZSH_VERSION+x} ] [ ! -z ${ZSH_VERSION+x} ]
} }
function git_diff_add() { function git_diff_add() {
@ -125,14 +125,14 @@ function set_ssh_agent_socket() {
# Determine size of a file or total size of a directory # Determine size of a file or total size of a directory
function fs() { function fs() {
if du -b /dev/null > /dev/null 2>&1; then if du -b /dev/null > /dev/null 2>&1; then
local arg=-sbh local arg=-sbh
else else
local arg=-sh local arg=-sh
fi fi
if [[ -n "$@" ]]; then if [[ -n "$@" ]]; then
du $arg -- "$@" du $arg -- "$@"
else else
du $arg .[^.]* * du $arg .[^.]* *
fi fi
} }
@ -140,8 +140,8 @@ function fs() {
function server() { function server() {
local port="${1:-8000}" local port="${1:-8000}"
sleep 1 && open "http://localhost:${port}/" & sleep 1 && open "http://localhost:${port}/" &
# Set the default Content-Type to `text/plain` instead of `application/octet-stream` # Set the default Content-Type to `text/plain` instead of `application/octet-stream`
# And serve everything as UTF-8 (although not technically correct, this doesnt break anything for binary files) # And serve everything as UTF-8 (although not technically correct, this doesnt break anything for binary files)
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
} }
@ -166,7 +166,7 @@ function oscopy() {
then then
reattach-to-user-namespace pbcopy reattach-to-user-namespace pbcopy
else else
test -n "$DISPLAY" && xclip -selection c test -n "$DISPLAY" && xclip -selection c
fi fi
} }
@ -175,7 +175,7 @@ function ospaste() {
then then
reattach-to-user-namespace pbpaste reattach-to-user-namespace pbpaste
else else
xclip -o xclip -o
fi fi
} }
@ -330,10 +330,10 @@ function python_module_path {
function mu4e_directory { function mu4e_directory {
if is_osx; then if is_osx; then
echo "$(brew --prefix mu)/share/emacs/site-lisp/mu4e" echo "$(brew --prefix mu)/share/emacs/site-lisp/mu4e"
else else
# TODO: make this cleaner. # TODO: make this cleaner.
echo "/usr/share/emacs/site-lisp/mu4e" echo "/usr/share/emacs/site-lisp/mu4e"
fi fi
} }
@ -388,7 +388,7 @@ function project_sync {
function android_sdk_directory { function android_sdk_directory {
if is_osx; then if is_osx; then
brew --prefix android-sdk brew --prefix android-sdk
fi fi
} }