Refactor and clean up of some of the fish and compilation stuffs

This commit is contained in:
ViViDboarder 2017-03-23 15:42:54 -07:00
parent e20e65b648
commit aefd589e0d
24 changed files with 133 additions and 174 deletions

View File

@ -20,21 +20,14 @@ if [ -d /opt/local ]; then
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
fi
export GOROOT=/usr/local/go
if [ -d "$GOROOT" ]; then
export PATH=$PATH:$GOROOT/bin
fi
if [[ "$DET_OS" == "linux" ]]; then
ANDROID_SDK=$HOME/workspace/adt-bundle-linux/sdk
elif [[ "$DET_OS" == "mac" ]]; then
ANDROID_SDK=$HOME/workspace/android-sdk-macosx
go_workspace=$HOME/workspace/go_workspace
if [ -d "$go_workspace" ]; then
export GOPATH=$go_workspace
export PATH=$PATH:$GOPATH/bin
fi
# Set GOPATH
GOROOT=/opt/local/lib/go
GOPATH=$HOME/workspace/go_path
# Fix Python path on OSX to avoid considering System extras over newer versions
# export PATH=$HOME/Library/Python/2.7/bin:$PATH
@ -43,8 +36,20 @@ elif [[ "$DET_OS" == "mac" ]]; then
fi
# Android paths
export ANDROID_HOME=$ANDROID_SDK
export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools
if [ -d "$ANDROID_SDK" ]; then
export ANDROID_HOME=$ANDROID_SDK
export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools
fi
# Go paths
if [ -d "$GOPATH" ]; then
export GOPATH
export PATH=$PATH:$GOPATH/bin
fi
if [ -d "$GOROOT" ]; then
export GOROOT
export PATH=$PATH:$GOROOT/bin
fi
# Home path
export PATH=$HOME/bin:$PATH

1
assets/default/fish/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.local.fish

View File

@ -1,3 +1,5 @@
# Completions for the Force.com cli
function __fish_force_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'force' ]

View File

@ -1,7 +1,7 @@
function source_config
function source_synced
# Sources a config file and corresponding local config file if it exists
set shared_config "$fisher_config/init/$argv[1].fish"
set local_config "$fisher_config/init/$argv[1].local.fish"
set -l shared_config "$fish_synced_dir/$argv[1].fish"
set -l local_config "$fish_synced_dir/$argv[1].local.fish"
if test -f "$shared_config"
source "$shared_config"
end

View File

@ -0,0 +1,5 @@
set -gx fish_function_path "$fish_synced_dir/functions" $fish_function_path
set -gx fish_complete_path "$fish_synced_dir/completions" $fish_complete_path
source_synced 'init/alias'
source_synced 'init/paths'

View File

@ -14,37 +14,35 @@ 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 go paths
set goroot /opt/local/lib/go
set gopath $HOME/workspace/go_path
# 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
# Google GO
if [ -d "$goroot" ]
set -gx GOROOT $goroot
set -gx PATH $PATH $GOROOT/bin
end
if [ -d "$gopath" ]
set -gx GOPATH $gopath
set -gx PATH $PATH $GOPATH/bin
end
# Android paths
set -gx ANDROID_HOME $android_sdk
set -gx PATH $PATH $android_sdk/platform-tools $android_sdk/tools
if [ -d "$android_sdk" ]
set -gx ANDROID_HOME $android_sdk
set -gx PATH $PATH $android_sdk/platform-tools $android_sdk/tools
end
# Home path
set -gx PATH $HOME/bin $PATH
@ -53,3 +51,7 @@ set -gx PATH $HOME/bin $PATH
# Increase memory sizes for java using Ant
set -gx ANT_OPTS "-Xmx2048m -Xms512m"
# FZF
set -gx FZF_DEFAULT_COMMAND 'ag -g ""'
set -gx FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND \$dir"

View File

@ -1,5 +0,0 @@
cache/
fisherman/init/*.local.fish
fisherman/completions/*
fisherman/functions/*
fisherman/man/*

View File

@ -21,24 +21,23 @@ if ! is_installed "packages" || prompt_yn "Reinstall packages?" ; then
install_packages=true
fi
install_vim_src=false
build_vim=false
if [ "$PACKAGE_MANAGER" == 'apt-get' ]; then
# Optional
is_installed "vim-from-source"
is_installed "build-vim"
if prompt_yn "Compile vim?" ; then
install_vim_src=true
build_vim=true
fi
fi
install_neovim=false
is_installed "neovim"
if prompt_yn "Install Neovim?" ; then
install_neovim=true
build_neovim=false
if ! command_exist 'nvim' && prompt_yn "Build Neovim?" ; then
build_neovim=true
fi
install_vim_settings=false
if ! is_installed "vim-settings" || prompt_yn "Reinstall vim-settings?" ; then
install_vim_settings=true
build_fish=false
if ! command_exist 'fish' && prompt_yn "Build Fish?" ; then
build_fish=true
fi
# Optional
@ -55,49 +54,34 @@ if prompt_yn "Install Go?" ; then
install_golang=true
fi
# Optional
install_fish=false
install_ohmyfish=false
install_fisherman=false
is_installed "fish"
is_installed "oh-my-fish"
is_installed "fisherman"
if prompt_yn "Install fish?" ; then
install_fish=true
if prompt_yn "Install oh-my-fish?" ; then
install_ohmyfish=true
elif prompt_yn "Install Fisherman?" ; then
install_fisherman=true
fi
fi
### Run recipes
recipe 'dotfiles'
recipe 'bin'
recipe 'git'
git submodule init
git submodule update
if $install_packages ; then
recipe 'packages'
set_installed "packages"
fi
if $install_vim_src ; then
recipe 'compile-install-vim'
set_installed "vim-from-source"
recipe 'dotfiles'
recipe 'bin'
recipe 'git'
recipe 'vim-settings'
recipe 'fish'
git submodule init
git submodule update
if $build_vim ; then
recipe 'build-vim'
set_installed "build-vim"
fi
if $install_neovim ; then
recipe 'neovim'
if $build_neovim ; then
recipe 'build-neovim'
set_installed "neovim"
fi
if $install_vim_settings ; then
recipe 'vim-settings'
set_installed 'vim-settings'
if $build_fish ; then
recipe 'build-fish'
set_installed "build-fish"
fi
if $install_sfdc ; then
@ -110,21 +94,6 @@ if $install_golang ; then
set_installed 'golang'
fi
if $install_fish ; then
recipe 'fish-install'
set_installed 'fish'
fi
if $install_ohmyfish ; then
recipe 'oh-my-fish'
set_installed 'oh-my-fish'
fi
if $install_fisherman ; then
recipe 'fisherman'
set_installed 'fisherman'
fi
### Show the Finished banner
finished

96
no-sudo
View File

@ -13,59 +13,41 @@ PROJECT_DIR=$(pwd)
init_paths_and_vars
install_vim_src=false
is_installed "vim-from-source"
if prompt_yn "Compile vim?" ; then
install_vim_src=true
fi
install_vim_settings=false
if ! is_installed "vim-settings" || prompt_yn "Reinstall vim-settings?" ; then
install_vim_settings=true
build_vim=false
is_installed "build-vim"
if prompt_yn "Build Vim from source?" ; then
build_vim=true
fi
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
install_mosh=false
is_installed "mosh"
if prompt_yn "Install Mosh from source?" ; then
install_mosh=true
fi
install_tmux=false
is_installed "tmux"
if prompt_yn "Install tmux from source?" ; then
install_tmux=true
fi
install_fish=false
install_ohmyfish=false
install_fisherman=false
is_installed "fish"
is_installed "oh-my-fish"
is_installed "fisherman"
if prompt_yn "Install fish?" ; then
install_fish=true
if prompt_yn "Install oh-my-fish?" ; then
install_ohmyfish=true
elif prompt_yn "Install Fisherman?" ; then
install_fisherman=true
fi
build_mosh=false
if ! command_exist 'mosh' && prompt_yn "Install Mosh from source?" ; then
build_mosh=true
fi
build_tmux=false
if ! command_exist 'tmux' && prompt_yn "Install tmux from source?" ; then
build_tmux=true
fi
build_fish=false
if ! command_exist 'fish' && prompt_yn "Install fish?" ; then
build_fish=true
fi
### Run recipes
recipe 'dotfiles'
recipe 'bin'
recipe 'git'
recipe 'vim-settings'
if $install_vim_src ; then
recipe 'compile-install-vim'
set_installed "vim-from-source"
fi
if $install_vim_settings ; then
recipe 'vim-settings'
set_installed 'vim-settings'
if $build_vim ; then
recipe 'build-vim'
set_installed "build-vim"
fi
if $install_sfdc ; then
@ -73,33 +55,23 @@ if $install_sfdc ; then
set_installed 'salesforce'
fi
if $install_mosh ; then
recipe 'mosh'
set_installed 'mosh-install'
if $build_mosh ; then
recipe 'build-mosh'
set_installed 'build-mosh'
fi
if $install_tmux ; then
recipe 'tmux-install'
set_installed 'tmux'
if $build_tmux ; then
recipe 'build-tmux'
set_installed 'build-tmux'
fi
if $install_fish ; then
if ! command_exist fish ; then
recipe 'fish-install'
fi
if command_exist fish ; then
set_installed 'fish'
fi
if $build_fish ; then
recipe 'build-fish'
set_installed "build-fish"
fi
if $install_ohmyfish ; then
recipe 'oh-my-fish'
set_installed 'oh-my-fish'
fi
if $install_fisherman ; then
recipe 'fisherman'
set_installed 'fisherman'
if command_exist 'fish' || is_installed 'build-fish' ; then
recipe 'fish'
fi
### Show the Finished banner

View File

@ -0,0 +1,14 @@
#! /bin/bash
log "Compiling and installing fish-shell"
local fish_shell_dir=$WORKSPACE/fish-shell
if [ ! -d $fish_shell_dir ]; then
log "Cloning fish-shell"
git clone https://github.com/fish-shell/fish-shell $fish_shell_dir
else
(cd $fish_shell_dir && git pull)
fi
(cd $fish_shell_dir && ./configure && make && sudo make install)

5
recipes/default/fish Normal file
View File

@ -0,0 +1,5 @@
#! /bin/bash
try_link $DEFAULT_ASSETS_PATH $XDG_CONFIG_HOME/fish/synced
add_line "set -gx fish_synced_dir $XDG_CONFIG_HOME/fish/synced " $XDG_CONFIG_HOME/fish/config.fish
add_line "source $XDG_CONFIG_HOME/fish/synced/init.fish " $XDG_CONFIG_HOME/fish/config.fish

View File

@ -1,5 +0,0 @@
#! /bin/bash
if ! command_exist fish ; then
sudo_package 'fish'
fi

View File

@ -1,17 +1,11 @@
#! /bin/bash
if [ ! -d "$fisher_home" ]; then
curl -L install.fisherman.sh | fish
fi
# 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"
add_line "source_config paths" $XDG_CONFIG_HOME/fish/config.fish
add_line "source_config alias" $XDG_CONFIG_HOME/fish/config.fish
# Link functions
mkdir -p $XDG_CONFIG_HOME/fish/functions
for func in ${DEFAULT_ASSETS_PATH}/fish/functions/*.fish; do
try_link "$func" $XDG_CONFIG_HOME/fish/functions/$(basename $func)
done
# Install from fishfile
fish -c 'fisher; exit'

View File

@ -1,7 +1,7 @@
#! /bin/bash
sudo_package_update
sudo_package 'screen tmux htop curl wget mercurial ctags tig pv jq'
sudo_package 'tmux htop curl wget mercurial ctags tig pv jq fish mosh'
# Manager specific packages
case "$PACKAGE_MANAGER" in