Skip to content

Commit

Permalink
namespace functions, export prompt variables, directory emoji.
Browse files Browse the repository at this point in the history
  • Loading branch information
smurthas committed Jun 14, 2014
1 parent 35d1d2b commit abd3815
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 77 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
12 changes: 8 additions & 4 deletions πŸ‘
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ GITHUB_URL="https://raw.githubusercontent.com/$GITHUB_REPO/master/$(python -c 'i
INSTALL_DIR=$HOME/.🚲
INSTALL_FILE=$INSTALL_DIR/🚲

# clean up any prior install
rm -r $INSTALL_DIR 2> /dev/null || true
mkdir $INSTALL_DIR
mkdir -p $INSTALL_DIR

FILENAME=${BASH_SOURCE[0]}
if [ -f $FILENAME ] && [[ "$FILENAME" != "" ]]
Expand All @@ -34,7 +32,13 @@ PROFILE_BKP=$PROFILE.🚲-bkp
cp $PROFILE $PROFILE_BKP

# add lines to the .profile and write it out
(cat $PROFILE | (grep -v "psemoji" || true) | grep -v "🚲" || true; echo "# psemoji prompt modification 🚲"; echo "source $INSTALL_FILE") > $PROFILE_TMP
(cat $PROFILE | (grep -v "psemoji" || true) | grep -v "🚲" || true; echo "# psemoji prompt modification 🚲"; echo "source $INSTALL_FILE";) > $PROFILE_TMP

# if they don't have any emoji in their prompt yet, let's add the defaults
source $PROFILE
if [[ !$(echo $PS1 | grep "_pse_") ]]; then
echo "export PS1=\$PSE_STANDARD$PS1" >> $PROFILE_TMP
fi

# check the line count of the new file
NEW_PROFILE_LINE_COUNT=`cat $PROFILE_TMP | wc -l`
Expand Down
Loading

0 comments on commit abd3815

Please sign in to comment.