(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
|
echo $BRICKS_DB/.tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec_brick() {
|
||||||
|
echo -e "$(bricksenv)\n$*" | bash
|
||||||
|
}
|
||||||
|
|
||||||
# checking that brick's dependencies are installed
|
# checking that brick's dependencies are installed
|
||||||
BRICK_DEPS=(curl)
|
BRICK_DEPS=(curl)
|
||||||
NO_DEPS=()
|
NO_DEPS=()
|
||||||
|
@ -126,8 +130,16 @@ while [[ $# -gt 0 ]]; do
|
||||||
-L)
|
-L)
|
||||||
inf "listing packages"
|
inf "listing packages"
|
||||||
for pkg in $(find $BRICKS_DIR -maxdepth 1 -type f -printf "%f\n" | grep -E \\.brick$ | sed 's/.brick//'); do
|
for pkg in $(find $BRICKS_DIR -maxdepth 1 -type f -printf "%f\n" | grep -E \\.brick$ | sed 's/.brick//'); do
|
||||||
source $(getbrick $pkg)
|
SCRIPT="\n
|
||||||
inf "$(inf "$pkg - $(info)")"
|
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
|
done
|
||||||
inf 'done'
|
inf 'done'
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -233,10 +245,6 @@ i=1
|
||||||
# pacman deps installed, lets install the actual shit
|
# pacman deps installed, lets install the actual shit
|
||||||
for pkg in "${PKGS[@]}"; do
|
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
|
# first check if there is stuff we need to download for that brick
|
||||||
|
|
||||||
SCRIPT="
|
SCRIPT="
|
||||||
|
|
|
@ -9,7 +9,7 @@ downloads=(
|
||||||
)
|
)
|
||||||
|
|
||||||
info() {
|
info() {
|
||||||
echo this brick does this and that
|
echo a reference example
|
||||||
}
|
}
|
||||||
|
|
||||||
license() {
|
license() {
|
||||||
|
|
Loading…
Reference in New Issue