Move all functions into seperate folder and source them

This commit is contained in:
Ilan Cosman 2020-04-16 01:09:07 -07:00
parent ebcab5a04d
commit 76c9a4a447
7 changed files with 15 additions and 10 deletions

5
conf.d/lean_source.fish Normal file
View File

@ -0,0 +1,5 @@
if not test -e "$__fish_config_dir/functions/fish_prompt.fish"
for file in $__fish_config_dir/lean_theme/*
source $file
end
end

View File

@ -1,12 +1,15 @@
echo "Installing lean theme..."
# -----------------Download Functions-----------------
set fns fish_prompt lean_git_prompt lean_pwd lean_uninstall user_ask
set githubFnsDir "https://raw.githubusercontent.com/IlanCosman/lean/master/functions"
set tempDir "/tmp/lean_theme"
set deleteThese install.fish README.md
for fn in $fns
wget -q "$githubFnsDir/$fn.fish" -O "$__fish_config_dir/functions/$fn.fish"
rm -rf $tempDir
git clone -q --depth=1 https://github.com/IlanCosman/lean.git $tempDir
for file in $deleteThese
rm "$tempDir/$file"
end
cp -r $tempDir $__fish_config_dir
# ----------------Set Theme Variables----------------
# --------------Colors--------------

View File

@ -1,13 +1,10 @@
function lean_uninstall
if user_ask "Unininstall lean theme?" y/N
echo "Uninstalling lean theme..."
# ------------------Remove Functions------------------
set fns fish_prompt lean_git_prompt lean_pwd lean_uninstall user_ask
for fn in $fns
rm "$__fish_config_dir/functions/$fn.fish"
end
# ------------------Remove Functions------------------
rm "$__fish_config_dir/conf.d/lean_source.fish"
rm -r "$__fish_config_dir/lean_theme/"
# ---------------Erase Theme Variables---------------
# --------------Colors--------------