Skip to content

Commit 8b08569

Browse files
committed
feat: Print to user when linking deps,bins,completion,man etc. Closes #25
1 parent 040285b commit 8b08569

9 files changed

+22
-10
lines changed

pkg/lib/commands/do-plumbing-clone.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ do-plumbing-clone() {
2424
gitArgs+=("$uri")
2525
gitArgs+=("$BPM_PACKAGES_PATH/$package")
2626

27+
log.info "Cloning package '$package'"
2728
git clone "${gitArgs[@]}"
2829
}

pkg/lib/commands/do-plumbing-deps.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ do-plumbing-deps() {
2424
IFS=':' read -ra deps <<< "$REPLY"
2525
fi
2626

27+
log.info "Installing dependencies for '$package'"
2728
for dep in "${deps[@]}"; do
2829
do-install "$dep"
2930
done

pkg/lib/commands/do-plumbing-link-bins.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
do-plumbing-link-bins() {
44
local package="$1"
5-
65
ensure.nonZero 'package' "$package"
76

7+
log.info "Linking bin files for '$package'"
8+
89
local REMOVE_EXTENSION=
910
local -a bins=()
1011

@@ -54,5 +55,4 @@ do-plumbing-link-bins() {
5455
ln -sf "$BPM_PACKAGES_PATH/$package/$bin" "$BPM_INSTALL_BIN/$name"
5556
chmod +x "$BPM_INSTALL_BIN/$name"
5657
done
57-
5858
}

pkg/lib/commands/do-plumbing-link-completions.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ do-plumbing-link-completions() {
44
local package="$1"
55
ensure.nonZero 'package' "$package"
66

7+
log.info "Linking completion files for '$package'"
8+
79
local -a completions=()
810
local -a bash_completions=() zsh_completions=()
911

pkg/lib/commands/do-plumbing-link-man.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ do-plumbing-link-man() {
55
local package="$1"
66
ensure.nonZero 'package' "$package"
77

8+
log.info "Linking man files for '$package'"
9+
810
local -a mans=()
911

1012
local bpmTomlFile="$BPM_PACKAGES_PATH/$package/bpm.toml"

pkg/lib/commands/do-plumbing-unlink-bins.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ do-plumbing-unlink-bins() {
44
local package="$1"
55
ensure.nonZero 'package' "$package"
66

7+
log.info "Unlinking bin files for '$package'"
8+
79
local -a bins=()
810
local REMOVE_EXTENSION=
911

pkg/lib/commands/do-plumbing-unlink-completions.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ do-plumbing-unlink-completions() {
44
local package="$1"
55
ensure.nonZero 'package' "$package"
66

7+
log.info "Unlinking completion files for '$package'"
8+
79
local -a bash_completions=() zsh_completions=()
810

911
local packageShFile="$BPM_PACKAGES_PATH/$package/package.sh"

pkg/lib/commands/do-plumbing-unlink-man.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ do-plumbing-unlink-man() {
44
local package="$1"
55
ensure.nonZero 'package' "$package"
66

7+
log.info "Unlinking man files for '$package'"
8+
79
local files=("$BPM_PACKAGES_PATH/$package"/man/*)
810
files=("${files[@]##*/}")
911

tests/do-plumbing-clone.bats

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load 'util/init.sh'
88
run do-plumbing-clone https://site/username/package.git username/package version
99

1010
assert_success
11-
assert_output "git clone --recursive --depth=1 --branch version https://site/username/package.git $BPM_PACKAGES_PATH/username/package"
11+
assert_line -n 1 "git clone --recursive --depth=1 --branch version https://site/username/package.git $BPM_PACKAGES_PATH/username/package"
1212
}
1313

1414
@test "does nothing if package is already present" {
@@ -17,7 +17,7 @@ load 'util/init.sh'
1717
run do-plumbing-clone https://github.com/username/package.git username/package
1818

1919
assert_failure
20-
assert_output -e "Package 'username/package' is already present"
20+
assert_line -n 0 -p "Package 'username/package' is already present"
2121
}
2222

2323
@test "does nothing if package is already present (as erroneous file)" {
@@ -27,7 +27,7 @@ load 'util/init.sh'
2727
run do-plumbing-clone https://github.com/username/package.git username/package
2828

2929
assert_failure
30-
assert_output -e "Package 'username/package' is already present"
30+
assert_line -n 0 -p "Package 'username/package' is already present"
3131
}
3232

3333
@test "using a different site" {
@@ -36,7 +36,7 @@ load 'util/init.sh'
3636
run do-plumbing-clone https://site/username/package.git username/package
3737

3838
assert_success
39-
assert_output "git clone --recursive --depth=1 https://site/username/package.git $BPM_PACKAGES_PATH/username/package"
39+
assert_line -n 1 "git clone --recursive --depth=1 https://site/username/package.git $BPM_PACKAGES_PATH/username/package"
4040
}
4141

4242

@@ -49,7 +49,7 @@ load 'util/init.sh'
4949
run do-plumbing-clone https://github.com/username/package.git username/package
5050

5151
assert_success
52-
assert_output "git clone --recursive https://github.com/username/package.git $BPM_PACKAGES_PATH/username/package"
52+
assert_line -n 1 "git clone --recursive https://github.com/username/package.git $BPM_PACKAGES_PATH/username/package"
5353
}
5454

5555
@test "setting BPM_FULL_CLONE to true, clones a package without depth option" {
@@ -59,7 +59,7 @@ load 'util/init.sh'
5959
run do-plumbing-clone https://github.com/username/package.git username/package
6060

6161
assert_success
62-
assert_output "git clone --recursive https://github.com/username/package.git $BPM_PACKAGES_PATH/username/package"
62+
assert_line -n 1 "git clone --recursive https://github.com/username/package.git $BPM_PACKAGES_PATH/username/package"
6363
}
6464

6565
# This is a difference in behavior compared to Basher. Setting
@@ -71,7 +71,7 @@ load 'util/init.sh'
7171
run do-plumbing-clone https://github.com/username/package.git username/package
7272

7373
assert_success
74-
assert_output "git clone --recursive https://github.com/username/package.git $BPM_PACKAGES_PATH/username/package"
74+
assert_line -n 1 "git clone --recursive https://github.com/username/package.git $BPM_PACKAGES_PATH/username/package"
7575
}
7676

7777
@test "using ssh protocol" {
@@ -80,5 +80,5 @@ load 'util/init.sh'
8080
run do-plumbing-clone git@site:username/package.git username/package
8181

8282
assert_success
83-
assert_output "git clone --recursive --depth=1 git@site:username/package.git $BPM_PACKAGES_PATH/username/package"
83+
assert_line -n 1 "git clone --recursive --depth=1 git@site:username/package.git $BPM_PACKAGES_PATH/username/package"
8484
}

0 commit comments

Comments
 (0)