Skip to content

Commit df0b9f6

Browse files
committed
fix: Error output
1 parent 959cdb8 commit df0b9f6

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ See [Installation](./docs/installation.md) and [Getting Started](./docs/getting-
3838
- Local and user-wide package installation
3939
- Configure (optionally) exactly which directories are used for completions, binaries, or man pages
4040
- Works with essentially all popular Bash projects out of the box
41-
- 220+ Tests
41+
- 240+ Tests
4242

4343
## Alternatives Comparison
4444

pkg/lib/commands/do-remove.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ do-remove() {
5151
local ref="$REPLY4"
5252

5353
if [ -n "$ref" ]; then
54-
die "Refs must be omitted when upgrading packages. Remove ref '@$ref'"
54+
die "Refs must be omitted when removing packages. Remove ref '@$ref'"
5555
fi
5656

5757
if [ -d "$BPM_PACKAGES_PATH/$site/$package" ]; then

pkg/lib/util/util.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ util.extract_data_from_input() {
7979
site="github.com"
8080
package="$repoSpec"
8181
else
82-
die "Invalid repository '$repoSpec'"
82+
die "Package '$repoSpec' does not appear to be formatted correctly"
8383
fi
8484

8585
if [[ "$package" == *@* ]]; then

tests/do-add.bats

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ load 'util/init.sh'
2828
assert_line -n 0 -p "Cannot install packages owned by username 'local' because that conflicts with linked packages"
2929
}
3030

31+
# TODO: do for link
3132
@test "fails when input is an absolute path to a directory" {
3233
local site='github.com'
3334
local pkg='username/main'

tests/do-remove.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ load 'util/init.sh'
194194
run do-upgrade "$pkg@v0.1.0"
195195

196196
assert_failure
197-
assert_line -p "Refs must be omitted when upgrading packages. Remove ref '@v0.1.0'"
197+
assert_line -p "Refs must be omitted when removing packages. Remove ref '@v0.1.0'"
198198
}

tests/util-extract-data-from-input.bats

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,10 @@ load 'util/init.sh'
166166
assert_failure
167167
assert_line -p "Directory specified with file protocol must have at least one parent directory"
168168
}
169+
170+
@test "errors with friendly message if format is not proper" {
171+
run util.extract_data_from_input 'UwU'
172+
173+
assert_failure
174+
assert_line -p "Package 'UwU' does not appear to be formatted correctly"
175+
}

0 commit comments

Comments
 (0)