build: generate a phar version of build-configs
This commit is contained in:
parent
ae6155dc39
commit
3a86b4813a
4 changed files with 72 additions and 24 deletions
45
run
Executable file
45
run
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
TTY="${TTY:-}"
|
||||
if [[ ! -t 1 ]]; then
|
||||
TTY="-T"
|
||||
fi
|
||||
|
||||
export PATH=$PATH:./bin:./vendor/bin:./vendor-bin/box/vendor/bin
|
||||
|
||||
# Delete any temporary or generated files.
|
||||
function clean {
|
||||
rm -frv build build-configs tmp vendor vendor-bin/box/vendor
|
||||
}
|
||||
|
||||
# Build the phar version of build-configs.
|
||||
function build {
|
||||
clean
|
||||
|
||||
# Install dependencies.
|
||||
composer validate
|
||||
composer install --no-dev --prefer-dist --optimize-autoloader
|
||||
composer install --prefer-dist --optimize-autoloader --working-dir ./vendor-bin/box
|
||||
|
||||
# Rebuild the Symfony cache.
|
||||
build-configs cache:clear
|
||||
|
||||
# Generate the phar file.
|
||||
box compile --config box.json.dist
|
||||
|
||||
# TODO: build a Nix derivation and add it to the store.
|
||||
}
|
||||
|
||||
# Display a list of all available commands.
|
||||
function help {
|
||||
printf "%s <task> [args]\n\nTasks:\n" "${0}"
|
||||
|
||||
compgen -A function | grep -v "^_" | cat -n
|
||||
|
||||
printf "\nExtended help:\n Each task has comments for general usage\n"
|
||||
}
|
||||
|
||||
TIMEFORMAT=$'\nTask completed in %3lR'
|
||||
time "${@:-help}"
|
Loading…
Add table
Add a link
Reference in a new issue