Installer tweaks

This commit is contained in:
Chris 2021-12-30 00:53:08 +01:00
parent 538383c33d
commit 5a1268aed6
5 changed files with 45 additions and 14 deletions

View File

@ -7,13 +7,18 @@ fi
if [ -z "$VERSION" ]; then
VERSION="$(git describe --tags)"
PATH="$PWD/tools:$PATH"
if [ -z "$VERSION" ]; then
echo "Could not parse version from git. Export VERSION if you are building manually."
exit 1
fi
fi
echo "* Version: $VERSION"
if [ ! -z "$FLAVOR" ]; then
VERSION="${VERSION}-${FLAVOR}"
echo "* Flavor: $FLAVOR"
fi
if [ -z "$VERSION" ]; then
echo "Could not parse version from git. Export VERSION if you are building manually."
exit 1
fi
PATH="$PWD/tools:$PATH"
if [ -z $DESTINATION ]; then
DESTINATION="release/$VERSION"

View File

@ -22,7 +22,7 @@ class StatusCommand extends Command
$stacks = $stackManager->getRegisteredStacks();
foreach ($stacks as $stack) {
$output->writeln("<fg=yellow>\u{2bbb}</> <fg=white;options=bold>{$stack->getName()}</>");
$output->writeln("<fg=cyan;options=bold>{$stack->getName()}</>");
$table = $stack->getContainersTable($output);
$table->setStyle('compact');
$table->setColumnWidths([ 30, 20, 20, 0 ]);

View File

@ -7,12 +7,14 @@ use Spark\Pipe\Filters\PhpFilter;
use Spark\Resource\ResourceType;
use Spark\SparkApplication;
$HELPERS = [];
function object(...$data) {
return (object)$data;
}
// ------- Helpers -------
$HELPERS = [];
function register_helper(string $name, callable $helper) {
global $HELPERS;
$HELPERS[$name] = $helper;
@ -28,6 +30,8 @@ function helper(string $name, ...$args) {
return $helper(...$args);
}
// ------ Plugins ------
function register_plugin(string $name, SparkPlug $plugin) {
$refl = new ReflectionClass($plugin);
$psr4 = object(
@ -50,6 +54,8 @@ function get_plugin(string $name) {
return SparkApplication::$instance->getPluginManager()->getPlugin($name);
}
// ------ Commands ------
function register_command(Command $command) {
SparkApplication::$instance->add($command);
}
@ -58,6 +64,8 @@ function get_environment(): Environment {
return SparkApplication::$instance->getEnvironment();
}
// ------ Resources ------
function register_resource_type(string $name, string $type) {
SparkApplication::$instance->getResourceManager()->registerResourceType($name, $type);
}

View File

@ -31,13 +31,16 @@ function askString(string $prompt, ?string $default=null) {
}
echo " ___ _ \n";
echo "/ __|_ __ __ _ _ _| |__\n";
echo "\\__ \\ '_ \\/ _` | '_| / /\n";
echo "|___/ .__/\\__,_|_| |_\\_\\\n";
echo " |_| \n";
$logo = require_once __DIR__."/logo.php";
echo $logo;
printf("\n%s\n \u{26a1} \e[1mSpark\e[0m Installer\n%s\n\n", str_repeat("\u{2500}",40), str_repeat("\u{2500}", 40));
//echo " ___ _ \n";
//echo "/ __|_ __ __ _ _ _| |__\n";
//echo "\\__ \\ '_ \\/ _` | '_| / /\n";
//echo "|___/ .__/\\__,_|_| |_\\_\\\n";
//echo " |_| \n";
printf("\n%s\n \u{26a1} \e[1mSpark\e[0m Installer\n%s\n\n", str_repeat("\u{2500}",80), str_repeat("\u{2500}", 80));
$destination = askString("Installation directory", getenv("HOME")."/opt/spark");
$binaries = askString("Path for executables", getenv("HOME")."/bin");

15
src/logo.php Normal file
View File

@ -0,0 +1,15 @@
<?php
return <<<EOT
▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀
▄▄▄▄▄▀▀▀▀▀▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀
▀▄▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▀▀▀▄▄▄▄▄▄▄▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▄▄▄▄▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▄▄▄▄▄▄▀▄▄▄▄▄▄▄▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▀

EOT;