Add some improvements
This commit is contained in:
parent
c5316e8318
commit
5dbdf3d311
4 changed files with 18 additions and 2 deletions
|
@ -30,6 +30,12 @@ commands:
|
|||
- name: group
|
||||
required: true
|
||||
help: The group to install
|
||||
flags:
|
||||
- long: --file
|
||||
short: -f
|
||||
help: File from which to read autoinstall-config
|
||||
arg: file
|
||||
default: $XDG_CONFIG_HOME/autoinstall.toml
|
||||
|
||||
- name: git
|
||||
help: Install a git repository
|
||||
|
|
|
@ -19,5 +19,12 @@ fi
|
|||
if [ -n "$clean" ] || [ -n "${AUTOINSTALL_CLEAN:-}" ]
|
||||
then
|
||||
echo "Cleaning $target"
|
||||
|
||||
# sanity checks
|
||||
if [ -z "$target" ] || [ "$target" = "/" ] || [ "$target" = "$HOME" ] || [ "$target" = "$HOME/" ]
|
||||
then
|
||||
echo "Invalid target: '$target'"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "$target"
|
||||
fi
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
group=${args[group]:?}
|
||||
file=${args[--file]:-}
|
||||
clean=${args[--clean]:-}
|
||||
|
||||
_config_query() {
|
||||
tomlq -c --arg group "$group" \
|
||||
'.autoinstall | map(select(.groups + ["all"] | contains([$group]))) | '"$1" \
|
||||
"$XDG_CONFIG_HOME/autoinstall.toml"
|
||||
"$file"
|
||||
}
|
||||
|
||||
_config_query ".[]" | while read -r entry; do
|
||||
|
@ -43,5 +44,5 @@ _config_query ".[]" | while read -r entry; do
|
|||
|
||||
install_args+=("$(eval "echo $target")")
|
||||
|
||||
autoinstall "${install_args[@]}"
|
||||
"$0" "${install_args[@]}"
|
||||
done
|
||||
|
|
2
run.sh
2
run.sh
|
@ -6,4 +6,6 @@ target=$(cat .target)
|
|||
|
||||
make generate
|
||||
|
||||
printf "\nBuild complete. Running...\n==========================\n\n"
|
||||
|
||||
"./output/$target" "$@"
|
||||
|
|
Loading…
Reference in a new issue