My configuration files for Debian/Ubuntu applications
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

42 lines
1000 B

  1. #!/usr/bin/env bash
  2. CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. HELPERS_DIR="$CURRENT_DIR/helpers"
  4. source "$HELPERS_DIR/plugin_functions.sh"
  5. plugin_dir_exists() {
  6. [ -d "$1" ]
  7. }
  8. # Runs all *.tmux files from the plugin directory.
  9. # Files are ran as executables.
  10. # No errors if the plugin dir does not exist.
  11. silently_source_all_tmux_files() {
  12. local plugin_path="$1"
  13. local plugin_tmux_files="$plugin_path*.tmux"
  14. if plugin_dir_exists "$plugin_path"; then
  15. for tmux_file in $plugin_tmux_files; do
  16. # if the glob didn't find any files this will be the
  17. # unexpanded glob which obviously doesn't exist
  18. [ -f "$tmux_file" ] || continue
  19. # runs *.tmux file as an executable
  20. $tmux_file >/dev/null 2>&1
  21. done
  22. fi
  23. }
  24. source_plugins() {
  25. local plugin plugin_path
  26. local plugins="$(tpm_plugins_list_helper)"
  27. for plugin in $plugins; do
  28. plugin_path="$(plugin_path_helper "$plugin")"
  29. silently_source_all_tmux_files "$plugin_path"
  30. done
  31. }
  32. main() {
  33. source_plugins
  34. }
  35. main