Forráskód Böngészése

:tada: Create install script

DricomDragon 1 hónapja
szülő
commit
cc6f6435af
2 módosított fájl, 36 hozzáadás és 0 törlés
  1. 10 0
      README.md
  2. 26 0
      install.fish

+ 10 - 0
README.md

@@ -150,6 +150,16 @@ Sorry, Godot override scale when using physics.
 
 To prevent the scale of your slide in the main scene to disturb your physics simulation, embed it into a subviewport. See the "embed your game" instruction above.
 
+## Bonus
+
+### Install script
+
+[fish](https://fishshell.com/) required.
+
+```sh
+GD_SHOW_PROJECTS=../myProject1/godot/ ./install.fish
+```
+
 ## License
 
 This plugin is free software licensed under the [MIT license](https://mit-license.org/), the same license used by the Godot engine itself.

+ 26 - 0
install.fish

@@ -0,0 +1,26 @@
+#!/usr/bin/fish
+
+if test -z $GD_SHOW_PROJECTS
+	echo "List your Godot project folder in env var GD_SHOW_PROJECTS (separated by spaces)"
+	exit 1
+end
+
+set SRC_FOLDER ./godot/addons/slide_show
+if not test -d $SRC_FOLDER
+	echo "This script should run in the Git Root folder"
+	exit 2
+end
+
+for f in $GD_SHOW_PROJECTS
+	echo "install GodotSlideShowPlugin in : $f"
+	if not test -d $f
+		echo "directory expected : $f"
+		exit 3
+	end
+	if not test -f $f/project.godot
+		echo "project.godot expected in : $f"
+		exit 4
+	end
+	mkdir --parents $f/addons/slide_show
+	rsync --delete --recursive --verbose $SRC_FOLDER $f/addons/
+end