parent
f44ae34d11
commit
b8c076efb3
2 changed files with 11 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
### master
|
### master
|
||||||
|
- if the plugin is not downloaded do not source it
|
||||||
|
|
||||||
### v1.0.0, 2014-08-05
|
### v1.0.0, 2014-08-05
|
||||||
- update readme because of github organization change to
|
- update readme because of github organization change to
|
||||||
|
|
|
@ -4,16 +4,22 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
source "$CURRENT_DIR/shared_functions.sh"
|
source "$CURRENT_DIR/shared_functions.sh"
|
||||||
|
|
||||||
|
plugin_dir_exists() {
|
||||||
|
[ -d "$1" ]
|
||||||
|
}
|
||||||
|
|
||||||
# Runs all *.tmux files from the plugin directory.
|
# Runs all *.tmux files from the plugin directory.
|
||||||
# Files are ran as executables.
|
# Files are ran as executables.
|
||||||
# No errors if the plugin dir does not exist.
|
# No errors if the plugin dir does not exist.
|
||||||
silently_source_all_tmux_files() {
|
silently_source_all_tmux_files() {
|
||||||
local plugin_path=$1
|
local plugin_path=$1
|
||||||
local plugin_tmux_files="$plugin_path*.tmux"
|
local plugin_tmux_files="$plugin_path*.tmux"
|
||||||
for tmux_file in $plugin_tmux_files; do
|
if plugin_dir_exists "$plugin_path"; then
|
||||||
# runs *.tmux file as an executable
|
for tmux_file in $plugin_tmux_files; do
|
||||||
$tmux_file >/dev/null 2>&1
|
# runs *.tmux file as an executable
|
||||||
done
|
$tmux_file >/dev/null 2>&1
|
||||||
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
source_plugin() {
|
source_plugin() {
|
||||||
|
|
Loading…
Reference in a new issue