From 8fdea9ed3ae9f324b58fb9f77239c10b4bf40382 Mon Sep 17 00:00:00 2001 From: philippe lhardy Date: Sat, 1 Nov 2025 16:15:15 +0100 Subject: [PATCH] copytominetest using metascript Signed-off-by: philippe lhardy --- .gitignore | 1 + README.md | 23 ++++++++++++++++-- copytominetest.sh | 59 ++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 70 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 34c9cf0..ed0ce45 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ devenv_params +artloglaby build/ \ No newline at end of file diff --git a/README.md b/README.md index 2fbee7c..cee9f73 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ - -This is a personal project to generate a 2D maze using in depth path generation. +# This is a personal project to generate a 2D maze using in depth path generation. This can generate a stl file, overall goal was to print it with a 3D printer. @@ -15,6 +14,26 @@ requirement : you need a java jdk environment installed ( java + javac ) and ant ex ubuntu : sudo apt-get install default-jdk ant +It can take various input + + * raw this tool raw format : see documentation raw + * imc esoteric internal format + * Drawing ? + * osm openstreetmap exported map + * we minetest/luanti world edit format + * Auto-generated + * Created through GUI + +and output + + * svg SVG / to handle with inkscape + * png + * raw this tool raw format : see documentation raw + * stl for 3d printers + * imc esoteric internal format + * txt labyrinth as text + * we minetest/luanti world edit format + ===== BUILD ===== See BUILD.md diff --git a/copytominetest.sh b/copytominetest.sh index b7cfadf..c91d5a8 100755 --- a/copytominetest.sh +++ b/copytominetest.sh @@ -1,20 +1,57 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2025 artlog@l0g.eu +# SPDX-License-Identifier: AGPL-3.0-or-later +# header generated by lib/metascript.sh header +# metascript_version=v1.0.0 + +toolsdir=lib +pushd $toolsdir >/dev/null +toolsdir=$(pwd) +source metascript.sh +popd >/dev/null + +usage() { + cat < 0 ]] +do + case "$1" in + name=*) + name=${1/name=}.we + ;; + game=*) + game=${1/game=} + ;; + *) + parsemetaarg "$1" + ;; + esac + shift +done -name=$1.we -srcdir=lab/ -game=nm dest=~/.minetest/worlds/$game/schems +src=${srcdir}$name -if [[ ! -d $dest ]] -then - echo "[ERROR] no destination directory $dest found" >&2 -fi - -src=$srcdir/$name +enforce file $src exists +enforce dir $dest exists if [[ -f $src ]] then - cp $src $dest/ + $defer cp $src $dest/ else - echo "[ERROR] missing $src" >&2 + log_error "missing $src" fi