Update clangs variables in fish
This commit is contained in:
parent
42726980a5
commit
34aaf8817c
|
@ -22,8 +22,8 @@ function fish_title
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compiler
|
# Compiler
|
||||||
export CC=/usr/local/bin/clang80
|
export CC=/usr/bin/clang
|
||||||
export CXX=/usr/local/bin/clang++80
|
export CXX=/usr/bin/clang++
|
||||||
|
|
||||||
# fff
|
# fff
|
||||||
## Directory color [0-9]
|
## Directory color [0-9]
|
||||||
|
|
|
@ -126,12 +126,44 @@ function __fundle_get_url -d "returns the url for the given plugin" -a repo
|
||||||
echo "https://github.com/$repo.git"
|
echo "https://github.com/$repo.git"
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fundle_update_plugin -d "update the given plugin" -a git_dir -a remote_url
|
|
||||||
command git --git-dir=$git_dir remote set-url origin $remote_url 2>/dev/null; and \
|
function __fundle_plugin_index -d "returns the index of the plugin" -a plugin
|
||||||
command git --git-dir=$git_dir fetch -q 2>/dev/null
|
for i in (__fundle_seq (count $__fundle_plugin_names))
|
||||||
|
if test "$__fundle_plugin_names[$i]" = "$plugin"
|
||||||
|
return $i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# NOTE: should never reach this point
|
||||||
|
echo "could not find plugin: $plugin"
|
||||||
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fundle_install_plugin -d "install/update the given plugin" -a plugin -a git_url
|
function __fundle_checkout_revision -a plugin -a git_url
|
||||||
|
set -l plugin_dir (__fundle_plugins_dir)/$plugin
|
||||||
|
set -l git_dir $plugin_dir/.git
|
||||||
|
|
||||||
|
set -l sha (__fundle_commit_sha $git_dir (__fundle_url_rev $git_url))
|
||||||
|
if test $status -eq 0
|
||||||
|
command git --git-dir="$git_dir" --work-tree="$plugin_dir" checkout -q -f $sha
|
||||||
|
else
|
||||||
|
echo "Could not checkout $plugin revision $sha"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fundle_update_plugin -d "update the given plugin" -a plugin -a git_url
|
||||||
|
echo "Updating $plugin"
|
||||||
|
|
||||||
|
set -l remote_url (__fundle_remote_url $git_url)
|
||||||
|
set -l git_dir (__fundle_plugins_dir)/$plugin/.git
|
||||||
|
|
||||||
|
command git --git-dir=$git_dir remote set-url origin $remote_url 2>/dev/null
|
||||||
|
command git --git-dir=$git_dir fetch -q 2>/dev/null
|
||||||
|
|
||||||
|
__fundle_checkout_revision $plugin $git_url
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fundle_install_plugin -d "install the given plugin" -a plugin -a git_url
|
||||||
if __fundle_no_git
|
if __fundle_no_git
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
@ -139,31 +171,30 @@ function __fundle_install_plugin -d "install/update the given plugin" -a plugin
|
||||||
set -l plugin_dir (__fundle_plugins_dir)/$plugin
|
set -l plugin_dir (__fundle_plugins_dir)/$plugin
|
||||||
set -l git_dir $plugin_dir/.git
|
set -l git_dir $plugin_dir/.git
|
||||||
set -l remote_url (__fundle_remote_url $git_url)
|
set -l remote_url (__fundle_remote_url $git_url)
|
||||||
set -l update ""
|
|
||||||
|
|
||||||
if contains __update $argv
|
|
||||||
set update true
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -d $plugin_dir
|
if test -d $plugin_dir
|
||||||
if test -n "$update"
|
|
||||||
echo "Updating $plugin"
|
|
||||||
__fundle_update_plugin $git_dir $remote_url
|
|
||||||
else
|
|
||||||
echo "$argv[1] installed in $plugin_dir"
|
echo "$argv[1] installed in $plugin_dir"
|
||||||
return 0
|
return 0
|
||||||
end
|
|
||||||
else
|
else
|
||||||
echo "Installing $plugin"
|
echo "Installing $plugin"
|
||||||
command git clone -q $remote_url $plugin_dir
|
command git clone -q $remote_url $plugin_dir
|
||||||
|
__fundle_checkout_revision $plugin $git_url
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fundle_update -d "update the given plugin, or all if unspecified" -a plugin
|
||||||
|
if test -n "$plugin"; and test ! -d (__fundle_plugins_dir)/$plugin/.git
|
||||||
|
echo "$plugin not installed. You may need to run 'fundle install'"
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l sha (__fundle_commit_sha $git_dir (__fundle_url_rev $git_url))
|
if test -n "$plugin"
|
||||||
if test $status -eq 0
|
set -l index (__fundle_plugin_index $plugin)
|
||||||
command git --git-dir="$git_dir" --work-tree="$plugin_dir" checkout -q -f $sha
|
__fundle_update_plugin "$plugin" $__fundle_plugin_urls[$index]
|
||||||
else
|
else
|
||||||
echo "Could not update $plugin"
|
for i in (__fundle_seq (count $__fundle_plugin_names))
|
||||||
return 1
|
__fundle_update_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -196,11 +227,11 @@ function __fundle_load_plugin -a plugin -a path -a fundle_dir -a profile -d "loa
|
||||||
set -l plugin_paths $__fundle_plugin_name_paths
|
set -l plugin_paths $__fundle_plugin_name_paths
|
||||||
|
|
||||||
if begin; test -d $functions_dir; and not contains $functions_dir $fish_function_path; end
|
if begin; test -d $functions_dir; and not contains $functions_dir $fish_function_path; end
|
||||||
set fish_function_path $functions_dir $fish_function_path
|
set fish_function_path $fish_function_path[1] $functions_dir $fish_function_path[2..-1]
|
||||||
end
|
end
|
||||||
|
|
||||||
if begin; test -d $completions_dir; and not contains $completions_dir $fish_complete_path; end
|
if begin; test -d $completions_dir; and not contains $completions_dir $fish_complete_path; end
|
||||||
set fish_complete_path $completions_dir $fish_complete_path
|
set fish_complete_path $fish_complete_path[1] $completions_dir $fish_complete_path[2..-1]
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -f $init_file
|
if test -f $init_file
|
||||||
|
@ -211,9 +242,11 @@ function __fundle_load_plugin -a plugin -a path -a fundle_dir -a profile -d "loa
|
||||||
source $f
|
source $f
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# read all *.fish files if no init.fish or conf.d found
|
# For compatibility with oh-my-fish themes, if there is no `init.fish` file in the plugin,
|
||||||
for f in $plugin_dir/*.fish
|
# which is the case with themses, the root directory of the plugin is trerated as a functions
|
||||||
source $f
|
# folder, so we include it in the `fish_function_path` variable.
|
||||||
|
if not contains $plugin_dir $fish_function_path
|
||||||
|
set fish_function_path $fish_function_path[1] $plugin_dir $fish_function_path[2..-1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -289,11 +322,6 @@ function __fundle_install -d "install plugin"
|
||||||
__fundle_show_doc_msg "No plugin registered. You need to call 'fundle plugin NAME' before using 'fundle install'"
|
__fundle_show_doc_msg "No plugin registered. You need to call 'fundle plugin NAME' before using 'fundle install'"
|
||||||
end
|
end
|
||||||
|
|
||||||
if begin; contains -- -u $argv; or contains -- --upgrade $argv; end
|
|
||||||
echo "deprecation warning: please use 'fundle update' to update plugins"
|
|
||||||
set argv $argv __update
|
|
||||||
end
|
|
||||||
|
|
||||||
for i in (__fundle_seq (count $__fundle_plugin_names))
|
for i in (__fundle_seq (count $__fundle_plugin_names))
|
||||||
__fundle_install_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i] $argv
|
__fundle_install_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i] $argv
|
||||||
end
|
end
|
||||||
|
@ -408,7 +436,7 @@ function fundle -d "run fundle"
|
||||||
case "install"
|
case "install"
|
||||||
__fundle_install $sub_args
|
__fundle_install $sub_args
|
||||||
case "update"
|
case "update"
|
||||||
__fundle_install __update $sub_args
|
__fundle_update $sub_args
|
||||||
case "clean"
|
case "clean"
|
||||||
__fundle_clean
|
__fundle_clean
|
||||||
case "self-update"
|
case "self-update"
|
||||||
|
|
Loading…
Reference in New Issue