Skip to content

Commit 3838cf7

Browse files
committed
feat: Add list command for local packages
1 parent fe6674a commit 3838cf7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pkg/lib/cmd/basalt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ basalt.main() {
3636
add) shift; do-add "$@" ;;
3737
remove) shift; do-remove "$@" ;;
3838
install) shift; do-install "$@" ;;
39+
list) shift; do-list "$@" ;;
3940
run) shift; do-run "$@" ;;
4041
complete) shift; do-complete "$@" ;;
4142
global) shift

pkg/lib/commands/do-list.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# shellcheck shell=bash
2+
3+
do-list() {
4+
util.init_local
5+
6+
if util.get_toml_array "$BASALT_LOCAL_PROJECT_DIR/basalt.toml" 'dependencies'; then
7+
for dependency in "${REPLIES[@]}"; do
8+
util.get_package_info "$dependency"
9+
local url="$REPLY2" version="$REPLY5"
10+
printf '%s\n' "$url@$version"
11+
done
12+
fi
13+
}

0 commit comments

Comments
 (0)