copytominetest using metascript
Signed-off-by: philippe lhardy <philippe.lhardy@astrolabe.coop>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
devenv_params
|
devenv_params
|
||||||
|
artloglaby
|
||||||
build/
|
build/
|
||||||
23
README.md
23
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.
|
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
|
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 =====
|
===== BUILD =====
|
||||||
|
|
||||||
See BUILD.md
|
See BUILD.md
|
||||||
|
|||||||
@@ -1,20 +1,57 @@
|
|||||||
#!/bin/bash
|
#!/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
|
dest=~/.minetest/worlds/$game/schems
|
||||||
|
src=${srcdir}$name
|
||||||
|
|
||||||
if [[ ! -d $dest ]]
|
enforce file $src exists
|
||||||
then
|
enforce dir $dest exists
|
||||||
echo "[ERROR] no destination directory $dest found" >&2
|
|
||||||
fi
|
|
||||||
|
|
||||||
src=$srcdir/$name
|
|
||||||
|
|
||||||
if [[ -f $src ]]
|
if [[ -f $src ]]
|
||||||
then
|
then
|
||||||
cp $src $dest/
|
$defer cp $src $dest/
|
||||||
else
|
else
|
||||||
echo "[ERROR] missing $src" >&2
|
log_error "missing $src"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user