From 1d2bde24030d7a71dd117a0772dc224f0344b364 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Thu, 12 Aug 2021 15:26:12 +0000 Subject: Meta: Add new-project.sh :^) This script will instantiate a HackStudio template into a project on the host. It currently supports all templates used by HackStudio. To avoid having to maintain compatibility between other shells and the Serenity shell in the postcreate scripts, we build the Serenity shell with Lagom and use that to run the script. --- Meta/new-project.sh | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 Meta/new-project.sh (limited to 'Meta/new-project.sh') diff --git a/Meta/new-project.sh b/Meta/new-project.sh new file mode 100755 index 0000000000..be60745732 --- /dev/null +++ b/Meta/new-project.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +set -euo pipefail + +script_path="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" +cd "${script_path}/.." + +script_name="$(basename "$0")" + +function list_templates() { + echo "Available templates:" + for file in ./Base/res/devel/templates/*.ini; do + printf ' %s - ' "$(basename "${file%%.ini}")" + awk -F "=" '/Description/ { print $2 }' "$file" + done +} + +function usage() { + local return_code=${1:-0} + + cat <