File tree Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ do_actual_upgrade() {
61
61
do-plumbing-unlink-bins " $id "
62
62
do-plumbing-unlink-completions " $id "
63
63
do-plumbing-unlink-man " $id "
64
- local git_output=
65
64
65
+ local git_output=
66
66
if ! git_output=" $( git -C " $BPM_PACKAGES_PATH /$id " pull 2>&1 ) " ; then
67
67
log.error " Could not update Git repository"
68
68
printf " %s\n" " $git_output "
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
3
- abstract_bins_did=no
4
-
5
3
abstract.bins () {
6
4
local action=" $1 "
7
5
local id=" $2 "
8
6
ensure.non_zero ' action' " $action "
9
7
ensure.non_zero ' id' " $id "
10
8
9
+ abstract_bins_did=no
10
+
11
11
local -a bins=()
12
12
local remove_extensions=
13
13
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
3
- abstract_completions_did=no
4
-
5
3
abstract.completions () {
6
4
local action=" $1 "
7
5
local id=" $2 "
8
6
ensure.non_zero ' action' " $action "
9
7
ensure.non_zero ' id' " $id "
10
8
ensure.package_exists " $id "
11
9
10
+ abstract_completions_did=no
11
+
12
12
local bpm_toml_file=" $BPM_PACKAGES_PATH /$id /bpm.toml"
13
13
local package_sh_file=" $BPM_PACKAGES_PATH /$id /package.sh"
14
14
@@ -155,7 +155,7 @@ abstract.completions_do_action_zsh() {
155
155
local file=" $2 "
156
156
157
157
abstract.completions_do_echo
158
-
158
+
159
159
if grep -qs " ^#compdef" " $file " ; then
160
160
local fileName=" ${file##*/ } "
161
161
if [ " ${fileName:: 1} " != _ ]; then
Original file line number Diff line number Diff line change 1
1
# shellcheck shell=bash
2
2
3
- abstract_mans_did=no
4
3
5
4
abstract.mans () {
6
5
local action=" $1 "
@@ -9,6 +8,8 @@ abstract.mans() {
9
8
ensure.non_zero ' id' " $id "
10
9
ensure.package_exists " $id "
11
10
11
+ abstract_mans_did=no
12
+
12
13
local bpm_toml_file=" $BPM_PACKAGES_PATH /$id /bpm.toml"
13
14
14
15
if [ -f " $bpm_toml_file " ]; then
Original file line number Diff line number Diff line change @@ -48,6 +48,33 @@ load 'util/init.sh'
48
48
assert_line -p " Package '$BPM_ORIGIN_DIR /$pkg ' is not installed"
49
49
}
50
50
51
+ @test " simple upgrade properly prints linking and unlinking messages" {
52
+ local site=' github.com'
53
+ local pkg=' somedir/package'
54
+
55
+ test_util.create_package " $pkg "
56
+ test_util.mock_clone " $pkg " " $site /$pkg "
57
+
58
+ cd " $BPM_ORIGIN_DIR /$pkg "
59
+ mkdir ' completions' ' bin' ' man' ' man/man1'
60
+ touch ' completions/file.sh' ' bin/file' ' man/man1/file.1'
61
+ git add .
62
+ git commit -m ' Add script'
63
+ cd " $BPM_CWD "
64
+
65
+ do-upgrade " $site /$pkg "
66
+
67
+ unset BPM_MODE_TEST
68
+ run do-upgrade " $pkg "
69
+
70
+ assert_success
71
+ assert_line -p -n 1 " Unlinking bin files"
72
+ assert_line -p -n 2 " Unlinking completion files"
73
+ assert_line -p -n 3 " Unlinking man files"
74
+ assert_line -p -n 4 " Linking bin files"
75
+ assert_line -p -n 5 " Linking completion files"
76
+ assert_line -p -n 6 " Linking man files"
77
+ }
51
78
52
79
@test " symlinks stay valid after upgrade" {
53
80
local site=' github.com'
You can’t perform that action at this time.
0 commit comments