Adds bootstrap.v2
This commit is contained in:
parent
06c8003cf2
commit
2bbccb4595
61 changed files with 468 additions and 4 deletions
58
.config/yadm/bootstrap.v2/bootstrap
Executable file
58
.config/yadm/bootstrap.v2/bootstrap
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
SCRIPTPATH="$(
|
||||
cd -- "$(dirname "$0")" >/dev/null 2>&1
|
||||
pwd -P
|
||||
)"
|
||||
APPLICATIONS_PATH="$SCRIPTPATH/applications"
|
||||
ACTIONS_PATH="$SCRIPTPATH/actions"
|
||||
|
||||
#$SCRIPTPATH/functions/set_class.sh
|
||||
source $SCRIPTPATH/functions/pkg.sh
|
||||
source $SCRIPTPATH/functions/filerunner.sh
|
||||
|
||||
if [[ ! -d "$APPLICATIONS_PATH" ]]; then
|
||||
echo "Error: applications directory '$APPLICATIONS_PATH' not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "# Updating system"
|
||||
updateSystem
|
||||
|
||||
echo "# Gathering applications"
|
||||
|
||||
declare -x -a applications
|
||||
declare -x -a actions
|
||||
actions=()
|
||||
|
||||
addApplications ()
|
||||
{
|
||||
for application in "$@"; do
|
||||
echo "adding application: $application"
|
||||
|
||||
applications+=("$application")
|
||||
done
|
||||
}
|
||||
|
||||
addActions()
|
||||
{
|
||||
for action in "$@"; do
|
||||
echo "adding action: $action"
|
||||
|
||||
actions+=("$action")
|
||||
done
|
||||
}
|
||||
|
||||
while IFS= read -r file; do
|
||||
if [[ -x "$file" && ! "$file" =~ "##" && ! "$file" =~ ~$ && ! "$file" =~ ".bak" ]]; then
|
||||
source $file
|
||||
fi
|
||||
done < <(find -L "$APPLICATIONS_PATH" -type f | sort)
|
||||
|
||||
echo -n "# Installing/Updating applications (${#applications[@]})"
|
||||
installPackages ${applications[*]}
|
||||
|
||||
echo "# Executing actions... (${#actions[@]})"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue