Skip to content

Commit d1655b3

Browse files
committed
fix: Improve error message when '--all' is not used in local mode
1 parent 65558d7 commit d1655b3

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

pkg/lib/commands/do-add.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ do-add() {
3737
fi
3838

3939
if [ "$BPM_MODE" = 'local' ] && (( ${#pkgs[@]} > 0 )); then
40-
die "Cannot specify individual packages for subcommand 'add' in local projects. Please edit your 'bpm.toml' and use either 'add --all' or 'remove --all'"
40+
die "Subcommands must use the '--all' flag when a 'bpm.toml' file is present"
4141
fi
4242

4343
if [[ "$BPM_MODE" == global && "$flag_all" == yes ]]; then

pkg/lib/commands/do-remove.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ do-remove() {
2929
fi
3030

3131
if [ "$BPM_MODE" = local ] && (( ${#pkgs[@]} > 0 )); then
32-
die "Cannot specify individual packages for subcommand 'remove' in local projects. Please edit your 'bpm.toml' and use either 'add --all' or 'remove --all'"
32+
die "Subcommands must use the '--all' flag when a 'bpm.toml' file is present"
3333
fi
3434

3535
if [[ $flag_all == yes && $flag_force == yes ]]; then

pkg/lib/commands/do-upgrade.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ do-upgrade() {
2929
fi
3030

3131
if [ "$BPM_MODE" = local ] && (( ${#pkgs[@]} > 0 )); then
32-
die "Cannot specify individual packages for subcommand 'upgrade' in local projects. Please edit your 'bpm.toml' and use either 'add --all' or 'remove --all'"
32+
die "Subcommands must use the '--all' flag when a 'bpm.toml' file is present"
3333
fi
3434

3535
if [[ $upgrade_bpm == yes && "$flag_all" = yes ]]; then

tests/do-add.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,5 +345,5 @@ load 'util/init.sh'
345345
BPM_MODE='local' run do-add "$pkg1"
346346

347347
assert_failure
348-
assert_line -p "Cannot specify individual packages for subcommand 'add' in local projects. Please edit your 'bpm.toml' and use either 'add --all' or 'remove --all'"
348+
assert_line -p "Subcommands must use the '--all' flag when a 'bpm.toml' file is present"
349349
}

tests/do-remove.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,5 @@ load 'util/init.sh'
255255
BPM_MODE='local' run do-remove "$pkg1"
256256

257257
assert_failure
258-
assert_line -p "Cannot specify individual packages for subcommand 'remove' in local projects. Please edit your 'bpm.toml' and use either 'add --all' or 'remove --all'"
258+
assert_line -p "Subcommands must use the '--all' flag when a 'bpm.toml' file is present"
259259
}

tests/do-upgrade.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,5 +219,5 @@ load 'util/init.sh'
219219
BPM_MODE='local' run do-upgrade "$pkg1"
220220

221221
assert_failure
222-
assert_line -p "Cannot specify individual packages for subcommand 'upgrade' in local projects. Please edit your 'bpm.toml' and use either 'add --all' or 'remove --all'"
222+
assert_line -p "Subcommands must use the '--all' flag when a 'bpm.toml' file is present"
223223
}

0 commit comments

Comments
 (0)