From 89b681e42d4d7efe37473342d25d453a4d311af9 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Tue, 25 Jul 2017 14:19:59 -0700 Subject: [PATCH] Clean fish stuff --- assets/default/fisherman/fisherman/fishfile | 3 - assets/default/oh-my-fish/.gitignore | 1 - assets/default/oh-my-fish/alias.fish | 37 --------- assets/default/oh-my-fish/bundle | 11 --- assets/default/oh-my-fish/init.fish | 14 ---- assets/default/oh-my-fish/paths.fish | 55 ------------- .../pkg/notify-funcs/notify-failure.fish | 3 - .../pkg/notify-funcs/notify-result.fish | 7 -- .../pkg/notify-funcs/notify-success.fish | 3 - assets/default/oh-my-fish/theme | 1 - .../oh-my-fish/themes/thefij/fish_prompt.fish | 79 ------------------- .../themes/thefij/fish_right_prompt.fish | 35 -------- master-cookbook | 6 +- recipes/default/fisherman | 11 --- recipes/default/oh-my-fish | 8 -- 15 files changed, 2 insertions(+), 272 deletions(-) delete mode 100644 assets/default/fisherman/fisherman/fishfile delete mode 100644 assets/default/oh-my-fish/.gitignore delete mode 100644 assets/default/oh-my-fish/alias.fish delete mode 100644 assets/default/oh-my-fish/bundle delete mode 100644 assets/default/oh-my-fish/init.fish delete mode 100644 assets/default/oh-my-fish/paths.fish delete mode 100644 assets/default/oh-my-fish/pkg/notify-funcs/notify-failure.fish delete mode 100644 assets/default/oh-my-fish/pkg/notify-funcs/notify-result.fish delete mode 100644 assets/default/oh-my-fish/pkg/notify-funcs/notify-success.fish delete mode 100644 assets/default/oh-my-fish/theme delete mode 100644 assets/default/oh-my-fish/themes/thefij/fish_prompt.fish delete mode 100644 assets/default/oh-my-fish/themes/thefij/fish_right_prompt.fish delete mode 100644 recipes/default/fisherman delete mode 100644 recipes/default/oh-my-fish diff --git a/assets/default/fisherman/fisherman/fishfile b/assets/default/fisherman/fisherman/fishfile deleted file mode 100644 index 82df319..0000000 --- a/assets/default/fisherman/fisherman/fishfile +++ /dev/null @@ -1,3 +0,0 @@ - -fishtape -bass diff --git a/assets/default/oh-my-fish/.gitignore b/assets/default/oh-my-fish/.gitignore deleted file mode 100644 index 80bc646..0000000 --- a/assets/default/oh-my-fish/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.local.fish diff --git a/assets/default/oh-my-fish/alias.fish b/assets/default/oh-my-fish/alias.fish deleted file mode 100644 index 8066c5b..0000000 --- a/assets/default/oh-my-fish/alias.fish +++ /dev/null @@ -1,37 +0,0 @@ -# vim -alias nv='nvim' -alias tv='tmux-vim' -alias :q='exit' - -# git -alias ga='git add' -alias gc='git commit' -alias gco='git checkout' -alias gd='git diff' -alias gl='git log' -alias gr='git rebase' -alias gs='git status' -alias tiga='tig --all' - -# cd -alias cd..='cd ..' - -# vim -alias mviml='env VIM_COLOR=github mvim' - -# terminal-notifier -alias notify-done='terminal-notifier -message "Done"' -alias notify-success='terminal-notifier -message "Success"' -alias notify-fail='terminal-notifier -message "Failure"' - -function sh-notify - [ $status = 0 ] ;and notify-success ;or notify-fail -end - -# gopush -alias pb-done='pb "Done"' -alias pb-success='pb "Success"' -alias pb-failure='pb "Failure"' -function pb-notify - [ $status = 0 ] ;and pb-success ;or pb-failure -end diff --git a/assets/default/oh-my-fish/bundle b/assets/default/oh-my-fish/bundle deleted file mode 100644 index cc3e937..0000000 --- a/assets/default/oh-my-fish/bundle +++ /dev/null @@ -1,11 +0,0 @@ -# package bak -# package balias -package export -package extract -package force -package jump -package notify-funcs -package osx -package pbcopy -package port -theme thefij diff --git a/assets/default/oh-my-fish/init.fish b/assets/default/oh-my-fish/init.fish deleted file mode 100644 index f579972..0000000 --- a/assets/default/oh-my-fish/init.fish +++ /dev/null @@ -1,14 +0,0 @@ -function source_config - # Sources a config file and corresponding local config file if it exists - set shared_config "$OMF_CONFIG/$argv[1].fish" - set local_config "$OMF_CONFIG/$argv[1].local.fish" - if test -f "$shared_config" - source "$shared_config" - end - if test -f "$local_config" - source "$local_config" - end -end - -source_config paths -source_config alias diff --git a/assets/default/oh-my-fish/paths.fish b/assets/default/oh-my-fish/paths.fish deleted file mode 100644 index 1c99844..0000000 --- a/assets/default/oh-my-fish/paths.fish +++ /dev/null @@ -1,55 +0,0 @@ -set det_os "unknown" - -switch (uname) - case "Darwin" - set det_os "mac" - case "Linux" - set det_os "linux" - case '*' - set det_os "unknown" -end - -# opt directory -if [ -d /opt/local ] - set -gx PATH /opt/local/bin /opt/local/sbin $PATH -end - -# Google GO -set -gx GOROOT /usr/local/go -if [ -d "$GOROOT" ] - set -gx PATH $PATH $GOROOT/bin -end - -if [ $det_os = "linux" ] - set android_sdk $HOME/workspace/adt-bundle-linux/sdk -else if [ $det_os = "mac" ] - set android_sdk $HOME/workspace/android-sdk-macosx - - set go_workspace $HOME/workspace/go_workspace - if [ -d "$go_workspace" ] - set -gx GOPATH $go_workspace - set -gx PATH $PATH $GOPATH/bin - end - - # set PATH $HOME/Library/Python/2.7/bin $PATH - # Fix Python path on OSX to avoid considering System extras over newer versions - set -gx PYTHONPATH /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages /Library/Python/2.7/site-packages $PYTHONPATH -end - -# Google cloud sdk -# set sdk_dir "$HOME/workspace/google-cloud-sdk" -# set bin_path "$sdk_dir/bin" -# set -gx PATH $bin_path $PATH -# set -gx PYTHONPATH "$sdk_dir/platform/google_appengine" $PYTHONPATH - -# Android paths -set -gx ANDROID_HOME $android_sdk -set -gx PATH $PATH $android_sdk/platform-tools $android_sdk/tools - -# Home path -set -gx PATH $HOME/bin $PATH - -#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* - -# Increase memory sizes for java using Ant -set -gx ANT_OPTS "-Xmx2048m -Xms512m" diff --git a/assets/default/oh-my-fish/pkg/notify-funcs/notify-failure.fish b/assets/default/oh-my-fish/pkg/notify-funcs/notify-failure.fish deleted file mode 100644 index 99614e8..0000000 --- a/assets/default/oh-my-fish/pkg/notify-funcs/notify-failure.fish +++ /dev/null @@ -1,3 +0,0 @@ -function notify-fail --description "Notify a failure message" - terminal-notifier -message "Failure" -end diff --git a/assets/default/oh-my-fish/pkg/notify-funcs/notify-result.fish b/assets/default/oh-my-fish/pkg/notify-funcs/notify-result.fish deleted file mode 100644 index 7d44833..0000000 --- a/assets/default/oh-my-fish/pkg/notify-funcs/notify-result.fish +++ /dev/null @@ -1,7 +0,0 @@ -function notify-result --description "Notify success or failure depending on the result of the previous command" - if [ $status -eq 0 ] - notify-success - else - notify-fail - end -end diff --git a/assets/default/oh-my-fish/pkg/notify-funcs/notify-success.fish b/assets/default/oh-my-fish/pkg/notify-funcs/notify-success.fish deleted file mode 100644 index 984404d..0000000 --- a/assets/default/oh-my-fish/pkg/notify-funcs/notify-success.fish +++ /dev/null @@ -1,3 +0,0 @@ -function notify-success --description "Notify a success message" - terminal-notifier -message "Success" -end diff --git a/assets/default/oh-my-fish/theme b/assets/default/oh-my-fish/theme deleted file mode 100644 index 952a658..0000000 --- a/assets/default/oh-my-fish/theme +++ /dev/null @@ -1 +0,0 @@ -thefij diff --git a/assets/default/oh-my-fish/themes/thefij/fish_prompt.fish b/assets/default/oh-my-fish/themes/thefij/fish_prompt.fish deleted file mode 100644 index 97d9bd8..0000000 --- a/assets/default/oh-my-fish/themes/thefij/fish_prompt.fish +++ /dev/null @@ -1,79 +0,0 @@ -# name: ifij (forked from RobbyRussel) -# -# You can override some default options in your config.fish: -# set -g theme_display_git_untracked no - -function _status_color - # Returns a color for successful or failed previous command - if test $last_status -eq 0 - echo (set_color -o green) - else - echo (set_color -o red) - end -end - -function _git_branch_name - # Returns the name of the current git branch - echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') -end - -function _is_git_dirty - # Returns whether or not there is anything uncommitted - set -l show_untracked (git config --bool bash.showUntrackedFiles) - set untracked '' - if [ "$theme_display_git_untracked" = 'no' -o "$show_untracked" = 'false' ] - set untracked '--untracked-files=no' - end - echo (command git status -s --ignore-submodules=dirty $untracked ^/dev/null) -end - -function _git_info - # Returns what is to be displayed for the git info - if [ (_git_branch_name) ] - if [ (_is_git_dirty) ] - set branch_color (set_color -o red) - else - set branch_color (set_color -o yellow) - end - set -l git_branch (_git_branch_name) - echo " $branch_color($git_branch)"(set_color normal) - end -end - -function _hostname - # Returns the hostname if not using tmux since tmux will display - if [ -z $TMUX ] - echo (hostname -s)" " - end -end - -function _prompt_char - # Gives a colored prompt char for user or root - echo -n (_status_color) - if [ (whoami) = 'root' ] - echo -n '#' - else - echo -n '$' - end - echo -n (set_color normal) -end - -function fish_prompt - # Build full left side prompt - - # NOTE: this becomes a global variable - set -g last_status $status - - set -l cyan (set_color -o cyan) - set -l yellow (set_color -o yellow) - set -l red (set_color -o red) - set -l blue (set_color -o blue) - set -l green (set_color -o green) - set -l normal (set_color normal) - - # set -l arrow (_status_color) "➜ $normal" - set -l cwd (basename (prompt_pwd)) - - echo -n -s $arrow (_hostname) $cwd (_git_info) (_prompt_char) ' ' -end - diff --git a/assets/default/oh-my-fish/themes/thefij/fish_right_prompt.fish b/assets/default/oh-my-fish/themes/thefij/fish_right_prompt.fish deleted file mode 100644 index 362318f..0000000 --- a/assets/default/oh-my-fish/themes/thefij/fish_right_prompt.fish +++ /dev/null @@ -1,35 +0,0 @@ -# TODO: [force_target] [virtualenv] -# TODO: Eventually... make pluggable so plugins can add to prompt - -# function _atf_target -# set -l org (atf-target 2> /dev/null) || return -# echo " [$org]" -# end -# -set -xg VIRTUAL_ENV_DISABLE_PROMPT 1 - -function _force_target - if [ (git config force.use) ] - set -l org (force-target) - echo " [$org]" - end -end - -function _virtual_env - if [ $VIRTUAL_ENV ] - set -l venv (basename "$VIRTUAL_ENV") - echo " [$venv]" - end -end - -function fish_right_prompt -d 'Write out the right prompt of thefij theme' - set -l cyan (set_color -o cyan) - set -l yellow (set_color -o yellow) - set -l red (set_color -o red) - set -l blue (set_color -o blue) - set -l green (set_color -o green) - set -l normal (set_color normal) - - echo -n $green (_force_target) (_virtual_env) - set_color normal -end diff --git a/master-cookbook b/master-cookbook index 51ae764..f624110 100755 --- a/master-cookbook +++ b/master-cookbook @@ -42,15 +42,13 @@ fi # Optional install_sfdc=false -is_installed "salesforce" -if prompt_yn "Install Salesforce tools?" ; then +if ! is_installed "salesforce" && prompt_yn "Install Salesforce tools?" ; then install_sfdc=true fi # Optional install_golang=false -is_installed "golang" -if prompt_yn "Install Go?" ; then +if ! command_exist 'go' && prompt_yn "Install Go?" ; then install_golang=true fi diff --git a/recipes/default/fisherman b/recipes/default/fisherman deleted file mode 100644 index 6f435aa..0000000 --- a/recipes/default/fisherman +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash - -# Install fisherman -curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisher - -# Link fisher configs -rm -fr "$XDG_CONFIG_HOME/fisherman" -try_link "${DEFAULT_ASSETS_PATH}/fisherman" "$XDG_CONFIG_HOME/fisherman" - -# Install from fishfile -fish -c 'fisher; exit' diff --git a/recipes/default/oh-my-fish b/recipes/default/oh-my-fish deleted file mode 100644 index 4a66cd4..0000000 --- a/recipes/default/oh-my-fish +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash - -local omf_config="$XDG_CONFIG_HOME/omf" -try_link "$DEFAULT_ASSETS_PATH" "$omf_config" - -if [ ! -d "$XDG_DATA_HOME/omf" ]; then - curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish -fi