(feat) brick.sh -L

This commit is contained in:
b1ek 2024-02-13 19:26:55 +10:00
parent 8861da21bf
commit 693430a180
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 33 additions and 19 deletions

View File

@ -66,25 +66,7 @@ PKGS=()
ERRORED=false
AUTOMATIC=false
# settings the PKGS var
# lets grab those from argv
while [[ $# -gt 0 ]]; do
case $1 in
-y|--noconfirm)
AUTOMATIC=true
shift;;
-*)
# meh domt need unkonw args
shift;;
*)
# everything else is a package name however
PKGS+=("$1")
shift;;
esac
done
# setting the BRICKS_DIR var
BRICKS_PWD=$(pwd)
while :; do
@ -99,11 +81,35 @@ while :; do
exit 1
fi
done
unset BRICKS_PWD
BRICKS_DB=$(brickdb)
BRICKS_INSTALLED=$(cat $BRICKS_DB/installed)
# settings the PKGS var
# lets grab those from argv
while [[ $# -gt 0 ]]; do
case $1 in
-y|--noconfirm)
AUTOMATIC=true
shift;;
-L)
inf "listing packages"
for pkg in $(find $BRICKS_DIR -maxdepth 1 -type f -printf "%f\n" | grep -E \\.brick$ | sed 's/.brick//'); do
source $(getbrick $pkg)
inf "$(inf "$pkg - $(info)")"
done
exit 0
;;
-*)
# meh domt need unkonw args
shift;;
*)
# everything else is a package name however
PKGS+=("$1")
shift;;
esac
done
PPKGS=()

View File

@ -4,6 +4,10 @@
# which also installs nvim
# this brick is GPL3 only
info() {
echo a fun vim-like editor
}
pkgs() {
echo neovim
}

View File

@ -2,6 +2,10 @@
# omz brick (pacakge is GPL3 only, omz itself is MIT (as of jan 2024))
# made by alice
info() {
echo a nice shell framework
}
pkgs() {
echo sh curl git zsh
}