Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <acidburn@google.com>
  • Loading branch information
jessfraz committed Oct 18, 2016
1 parent 88a84b9 commit 9c91c80
Show file tree
Hide file tree
Showing 30 changed files with 550 additions and 387 deletions.
2 changes: 2 additions & 0 deletions .Xprofile
@@ -1 +1,3 @@
#!/bin/sh

xcompmgr -c &
9 changes: 7 additions & 2 deletions .aliases
@@ -1,7 +1,7 @@
#!/bin/bash

# debian specific aliases
alias open='xdg-open "$@"'
alias open='xdg-open'
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'

Expand All @@ -27,15 +27,19 @@ else # OS X `ls`
fi

# List all files colorized in long format
# shellcheck disable=SC2139
alias l="ls -lF ${colorflag}"

# List all files colorized in long format, including dot files
# shellcheck disable=SC2139
alias la="ls -laF ${colorflag}"

# List only directories
# shellcheck disable=SC2139
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"

# Always use color output for `ls`
# shellcheck disable=SC2139
alias ls="command ls ${colorflag}"
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'

Expand Down Expand Up @@ -89,7 +93,8 @@ alias map="xargs -n1"

# One of @janmoesen’s ProTip™s
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
alias "$method"="lwp-request -m '$method'"
# shellcheck disable=SC2139,SC2140
alias "$method"="lwp-request -m \"$method\""
done

# Kill all the tabs in Chrome to free up memory
Expand Down
7 changes: 6 additions & 1 deletion .bash_profile
@@ -1,8 +1,13 @@
#!/bin/bash

# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
# * ~/.extra can be used for other settings you don’t want to commit.
for file in ~/.{bash_prompt,aliases,functions,path,dockerfunc,extra,exports}; do
[[ -r "$file" ]] && [[ -f "$file" ]] && source "$file"
if [[ -r "$file" ]] && [[ -f "$file" ]]; then
# shellcheck source=/dev/null
source "$file"
fi
done
unset file

Expand Down
14 changes: 9 additions & 5 deletions .bash_prompt
@@ -1,3 +1,4 @@
#!/bin/bash
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
Expand All @@ -15,7 +16,7 @@ prompt_git() {
local branchName='';

# Check if the current directory is in a Git repository.
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
if [ "$(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}")" == '0' ]; then

# check if the current directory is in .git before running git checks
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
Expand All @@ -25,12 +26,12 @@ prompt_git() {
fi;

# Check for uncommitted changes in the index.
if ! $(git diff --quiet --ignore-submodules --cached); then
if ! git diff --quiet --ignore-submodules --cached; then
s+='+';
fi;

# Check for unstaged changes.
if ! $(git diff-files --quiet --ignore-submodules --); then
if ! git diff-files --quiet --ignore-submodules --; then
s+='!';
fi;

Expand All @@ -40,7 +41,7 @@ prompt_git() {
fi;

# Check for stashed files.
if $(git rev-parse --verify refs/stash &>/dev/null); then
if git rev-parse --verify refs/stash &>/dev/null; then
s+='$';
fi;

Expand All @@ -62,7 +63,7 @@ prompt_git() {
}

cloud=""
if grep -q ^flags.*\ hypervisor /proc/cpuinfo ; then
if grep -q "^flags.* hypervisor" /proc/cpuinfo ; then
cloud="☁️ "
fi

Expand All @@ -84,11 +85,14 @@ if tput setaf 1 &> /dev/null; then
else
bold='';
reset="\e[0m";
# shellcheck disable=SC2034
black="\e[1;30m";
blue="\e[1;34m";
cyan="\e[1;36m";
green="\e[1;32m";
# shellcheck disable=SC2034
orange="\e[1;33m";
# shellcheck disable=SC2034
purple="\e[1;35m";
red="\e[1;31m";
violet="\e[1;35m";
Expand Down
13 changes: 10 additions & 3 deletions .bashrc
@@ -1,3 +1,4 @@
#!/bin/bash
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
Expand Down Expand Up @@ -63,6 +64,7 @@ esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
# shellcheck disable=SC2015
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
Expand All @@ -82,22 +84,27 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [[ -f /usr/share/bash-completion/bash_completion ]]; then
# shellcheck source=/dev/null
. /usr/share/bash-completion/bash_completion
elif [[ -f /etc/bash_completion ]]; then
# shellcheck source=/dev/null
. /etc/bash_completion
fi
fi
for file in /etc/bash_completion.d/* ; do
# shellcheck source=/dev/null
source "$file"
done

if [[ -f $HOME/.bash_profile ]]; then
source $HOME/.bash_profile
if [[ -f "${HOME}/.bash_profile" ]]; then
# shellcheck source=/dev/null
source "${HOME}/.bash_profile"
fi

# use a tty for gpg
# solves error: "gpg: signing failed: Inappropriate ioctl for device"
export GPG_TTY=$(tty)
export GPG_TTY
GPG_TTY=$(tty)
# Start the gpg-agent if not already running
if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
gpg-connect-agent /bye >/dev/null 2>&1
Expand Down

0 comments on commit 9c91c80

Please sign in to comment.