Skip to content

Commit

Permalink
fix(bash_profile): hidden function
Browse files Browse the repository at this point in the history
  • Loading branch information
sbolel authored Jul 18, 2017
1 parent 96b3075 commit d55415f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ function npm-head {

# toggle show/hide hidden files
function hidden {
if [[ $# == 0 || $1 == "show" ]]; then
if [[ $# == 0 ]]; then
local VALUE=`defaults read com.apple.finder AppleShowAllFiles`
fi
if [[ $VALUE == "NO" || $1 == "show" ]]; then
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder && printf "Hidden files shown!"
printf "Hidden files shown!"
elif [[ $VALUE == "YES" || $1 == "hide" ]]; then
defaults write com.apple.finder AppleShowAllFiles NO
printf "Hidden files hidden!"
fi
killall Finder
}

# replace authors in git history
Expand Down

0 comments on commit d55415f

Please sign in to comment.