Misc improvements

- Renamed the state file from `fresh.yml` to `.fresh.yml`.
- Added option `--state` to override the state file name.
- Renamed the lock file from `fresh.lock` to `.fresh.lock`.
- Added option `--lockfile` to override lockfile file name.
This commit is contained in:
2022-03-21 00:48:19 +01:00
parent 702cc3101e
commit 214db1cee3
4 changed files with 115 additions and 36 deletions

20
tools/build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# chdir into the root from wherever we are
cd "$(dirname "$(realpath "$0")")/.."
# determine the tag and output base
TAG="$(git describe --tags)"
OUT="dist/fresh-${TAG}"
NOW="$(date +"%Y-%m-%d")"
# create output directory
mkdir -p dist
# update version.php and build thephar
echo "<?php define(\"APP_VERSION\", \"${TAG}\"); define(\"BUILD_DATE\", \"${NOW}\");" > src/version.php
tools/pharlite
# copy raw phar into destination
cp -v fresh.phar "$OUT.phar"