From 18366975a188cb792f08d4a86c1f7700ae9b0bb9 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 17 Feb 2021 18:25:45 +0100 Subject: [PATCH] improve the run configurations --- README.md | 2 +- Run.bat | 11 +++++++++++ Run.sh | 5 ++--- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 Run.bat diff --git a/README.md b/README.md index 7de3262..847d4db 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Since Tiny Life uses early versions of some of my libraries, you will also have dotnet nuget add source https://nuget.ellpeck.de/v3/index.json --name "Ellpeck" ``` -This repository also contains a little script called `Run.sh` that you can use to automatically build your mod, copy it into the `Mods` directory of your Tiny Life instance and run the game. Just be sure to modify all of the paths first. +This repository also contains a little `Run` script for [windows](./Run.bat) and [linux and mac](./Run.sh) that automatically builds your mod, copies it into the `Mods` directory of your Tiny Life instance and runs the game. Note that the script will only work correctly if you've previously launched Tiny Life manually. The game's API is **fully documented**. The documentation is easily accessible by opening any of the API's files in your IDE. The most updated version can be found on [the wiki](https://github.com/Ellpeck/TinyLifeExampleMod/wiki) as well. diff --git a/Run.bat b/Run.bat new file mode 100644 index 0000000..2491be6 --- /dev/null +++ b/Run.bat @@ -0,0 +1,11 @@ +@echo off +rem move to the script directory +cd /d "%~dp0" +rem build the mod +dotnet build +rem copy the mod to the mods folder +robocopy ./bin/Debug/netcoreapp3.0/ "%LOCALAPPDATA%/Tiny Life/Mods" /e +rem run the game +set /p dir=<"%LOCALAPPDATA%/Tiny Life/GameDir" +cd /d %dir% +"Tiny Life.exe" \ No newline at end of file diff --git a/Run.sh b/Run.sh index 31b5dc1..a72dc71 100644 --- a/Run.sh +++ b/Run.sh @@ -1,6 +1,4 @@ #!/bin/bash -GAME_DIR="path/to/Tiny Life" - # move to the script directory cd "$(dirname "$0")" # build the mod @@ -8,5 +6,6 @@ dotnet build # copy the mod to the mods folder cp ./bin/Debug/netcoreapp3.0/* "$LOCALAPPDATA/Tiny Life/Mods" -r # run the game -cd "$GAME_DIR" +dir=$(<"$LOCALAPPDATA/Tiny Life/GameDir") +cd $dir "./Tiny Life.exe" \ No newline at end of file