copytominetest using metascript

Signed-off-by: philippe lhardy <philippe.lhardy@astrolabe.coop>
This commit is contained in:
2025-11-01 16:15:15 +01:00
parent 1d96ee089b
commit 8fdea9ed3a
3 changed files with 70 additions and 13 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
devenv_params
artloglaby
build/

View File

@@ -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

View File

@@ -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 <<EOF
copy a .we generated lab into minetest local game directory
name=name of generated .we without extension
game=name of game
EOF
}
metarun=metarun
# change default to sudo if needed
# metasudo=sudo
name="$1.we"
srcdir="lab/"
game="nm"
while [[ $# > 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