(fix) isolate listing command as well

This commit is contained in:
b1ek 2024-02-14 12:21:28 +10:00
parent caaf940f0c
commit 1937426dcb
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 15 additions and 7 deletions

View File

@ -75,6 +75,10 @@ tmpdir() {
echo $BRICKS_DB/.tmp
}
exec_brick() {
echo -e "$(bricksenv)\n$*" | bash
}
# checking that brick's dependencies are installed
BRICK_DEPS=(curl)
NO_DEPS=()
@ -126,8 +130,16 @@ while [[ $# -gt 0 ]]; do
-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)")"
SCRIPT="\n
source $(getbrick $pkg)\n
if [ \"\$(command -v info)\" == \"info\" ]; then\n
echo \$(info)\n
else\n
echo 'no info provided'\n
fi\n
"
# exec_brick $SCRIPT
inf "$(inf "$pkg - $(exec_brick $SCRIPT)")"
done
inf 'done'
exit 0
@ -233,10 +245,6 @@ i=1
# pacman deps installed, lets install the actual shit
for pkg in "${PKGS[@]}"; do
exec_brick() {
echo -e "$(bricksenv)$1" | bash
}
# first check if there is stuff we need to download for that brick
SCRIPT="

View File

@ -9,7 +9,7 @@ downloads=(
)
info() {
echo this brick does this and that
echo a reference example
}
license() {