diff --git a/dockerfiles/workspace/.bash_aliases.example b/dockerfiles/workspace/.bash_aliases.example new file mode 100644 index 0000000..1c5ce02 --- /dev/null +++ b/dockerfiles/workspace/.bash_aliases.example @@ -0,0 +1,6 @@ +alias gst='git status' +alias ga='git add' +alias gc='git commit -m' +alias gush='git push' +alias gull='git pull' +alias gb='git branch' diff --git a/dockerfiles/workspace/.gitignore b/dockerfiles/workspace/.gitignore index d02ad3c..b6c97b1 100644 --- a/dockerfiles/workspace/.gitignore +++ b/dockerfiles/workspace/.gitignore @@ -1,2 +1,3 @@ -/aliases.sh +/.bash_* +!/.bash_.example /crontab diff --git a/dockerfiles/workspace/aliases.sh.example b/dockerfiles/workspace/.shell-aliases similarity index 87% rename from dockerfiles/workspace/aliases.sh.example rename to dockerfiles/workspace/.shell-aliases index b497e54..e1d9ce4 100644 --- a/dockerfiles/workspace/aliases.sh.example +++ b/dockerfiles/workspace/.shell-aliases @@ -1,4 +1,5 @@ -#! /bin/bash +# If not running interactively, don't do anything +[ -z "$PS1" ] && return # Colors used for status updates ESC_SEQ="\x1b[" @@ -22,9 +23,5 @@ fi # Always use color output for `ls` alias ls="command ls ${colorflag}" -alias gst='git status' -alias ga='git add' -alias gc='git commit -m' -alias gush='git push' -alias gull='git pull' -alias gb='git branch' +# Source global definitions +test -r ~/.bash_aliases && . ~/.bash_aliases diff --git a/src/dockerfiles/workspace/workspace.base.Dockerfile b/src/dockerfiles/workspace/workspace.base.Dockerfile index d404d3f..ade936f 100644 --- a/src/dockerfiles/workspace/workspace.base.Dockerfile +++ b/src/dockerfiles/workspace/workspace.base.Dockerfile @@ -74,7 +74,7 @@ RUN sed -i 's/\r//' /root/aliases.sh && \ echo "" >> ~/.bashrc && \ echo "# Load Custom Aliases" >> ~/.bashrc && \ echo "source ~/aliases.sh" >> ~/.bashrc && \ - echo "" >> ~/.bashrc \ + echo "" >> ~/.bashrc ########################################################################### # ssh: