File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
26
26
27
27
# Other examples:
28
28
# set -g @plugin 'github_username/plugin_name'
29
+ # set -g @plugin 'github_username/plugin_name#branch'
29
30
# set -g @plugin 'git@github.com/user/plugin'
30
31
# set -g @plugin 'git@bitbucket.com/user/plugin'
31
32
Original file line number Diff line number Diff line change 15
15
clone () {
16
16
local plugin=" $1 "
17
17
cd " $( tpm_path) " &&
18
- GIT_TERMINAL_PROMPT=0 git clone --recursive " $plugin " > /dev/null 2>&1
18
+ GIT_TERMINAL_PROMPT=0 git clone -b " $branch " --single-branch - -recursive " $plugin " > /dev/null 2>&1
19
19
}
20
20
21
21
# tries cloning:
22
22
# 1. plugin name directly - works if it's a valid git url
23
23
# 2. expands the plugin name to point to a github repo and tries cloning again
24
24
clone_plugin () {
25
25
local plugin=" $1 "
26
- clone " $plugin " ||
27
- clone " https://git::@github.com/$plugin "
26
+ local branch=" $2 "
27
+ clone " $plugin " " $branch " ||
28
+ clone " https://git::@github.com/$plugin " " $branch "
28
29
}
29
30
30
31
# clone plugin and produce output
31
32
install_plugin () {
32
33
local plugin=" $1 "
34
+ local branch=` [ -z " $2 " ] && echo " master" || echo " $2 " `
33
35
local plugin_name=" $( plugin_name_helper " $plugin " ) "
34
36
35
37
if plugin_already_installed " $plugin " ; then
36
38
echo_ok " Already installed \" $plugin_name \" "
37
39
else
38
40
echo_ok " Installing \" $plugin_name \" "
39
- clone_plugin " $plugin " &&
41
+ clone_plugin " $plugin " " $branch " &&
40
42
echo_ok " \" $plugin_name \" download success" ||
41
43
echo_err " \" $plugin_name \" download fail"
42
44
fi
@@ -45,7 +47,8 @@ install_plugin() {
45
47
install_plugins () {
46
48
local plugins=" $( tpm_plugins_list_helper) "
47
49
for plugin in $plugins ; do
48
- install_plugin " $plugin "
50
+ IFS=' #' read -ra plugin <<< " $plugin"
51
+ install_plugin " ${plugin[0]} " " ${plugin[1]} "
49
52
done
50
53
}
51
54
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ source_plugins() {
30
30
local plugin plugin_path
31
31
local plugins=" $( tpm_plugins_list_helper) "
32
32
for plugin in $plugins ; do
33
- plugin_path=" $( plugin_path_helper " $plugin " ) "
33
+ IFS=' #' read -ra plugin <<< " $plugin"
34
+ plugin_path=" $( plugin_path_helper " ${plugin[0]} " ) "
34
35
silently_source_all_tmux_files " $plugin_path "
35
36
done
36
37
}
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ update_all() {
37
37
echo_ok " "
38
38
local plugins=" $( tpm_plugins_list_helper) "
39
39
for plugin in $plugins ; do
40
- local plugin_name=" $( plugin_name_helper " $plugin " ) "
40
+ IFS=' #' read -ra plugin <<< " $plugin"
41
+ local plugin_name=" $( plugin_name_helper " ${plugin[0]} " ) "
41
42
# updating only installed plugins
42
43
if plugin_already_installed " $plugin_name " ; then
43
44
update " $plugin_name " &
@@ -49,7 +50,8 @@ update_all() {
49
50
update_plugins () {
50
51
local plugins=" $* "
51
52
for plugin in $plugins ; do
52
- local plugin_name=" $( plugin_name_helper " $plugin " ) "
53
+ IFS=' #' read -ra plugin <<< " $plugin"
54
+ local plugin_name=" $( plugin_name_helper " ${plugin[0]} " ) "
53
55
if plugin_already_installed " $plugin_name " ; then
54
56
update " $plugin_name " &
55
57
else
You can’t perform that action at this time.
0 commit comments