(fix) isolate listing command as well
This commit is contained in:
parent
caaf940f0c
commit
1937426dcb
20
brick.sh
20
brick.sh
|
@ -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="
|
||||
|
|
|
@ -9,7 +9,7 @@ downloads=(
|
|||
)
|
||||
|
||||
info() {
|
||||
echo this brick does this and that
|
||||
echo a reference example
|
||||
}
|
||||
|
||||
license() {
|
||||
|
|
Loading…
Reference in New Issue