Skip to content

Commit

Permalink
fix: Addon installed to project root (#143)
Browse files Browse the repository at this point in the history
When installed from Godot's AssetLib tab, addons are installed to the
project root, instead of the addons directory. Looking at other addons,
it looks like the root folder isn't addons, but `<addon-name>-<hash>`.
Doing the same for netfox should solve this issue.

Note that there's no known way to validate this locally, so further PRs
might be needed.

Refs #140
  • Loading branch information
elementbound authored Nov 26, 2023
1 parent d5c1a5c commit 4d68e41
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ mono_crash.*.json
# End of https://www.toptal.com/developers/gitignore/api/godot

build
buildtmp
2 changes: 1 addition & 1 deletion addons/netfox.extras/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.extras"
description="Game-specific utilities for Netfox"
author="Tamas Galffy"
version="1.0.0"
version="1.0.1"
script="netfox-extras.gd"
2 changes: 1 addition & 1 deletion addons/netfox.noray/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.noray"
description="Bulletproof your connectivity with noray integration for netfox"
author="Tamas Galffy"
version="1.0.0"
version="1.0.1"
script="netfox-noray.gd"
2 changes: 1 addition & 1 deletion addons/netfox/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox"
description="A higher-level networking addon with rollback support"
author="Tamas Galffy"
version="1.0.0"
version="1.0.1"
script="netfox.gd"
32 changes: 28 additions & 4 deletions sh/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,44 @@
BOLD="$(tput bold)"
NC="$(tput sgr0)"

ROOT="$(pwd)"
BUILD="$ROOT/build"
TMP="$ROOT/buildtmp"

# Assume we're running from project root
source sh/shared.sh

echo $BOLD"Building netfox v${version}" $NC
rm -rf build
mkdir -p build

echo "Directories"
echo "Root: $ROOT"
echo "Build: $BUILD"
echo "Temp: $TMP"

rm -rf "$BUILD"
mkdir -p "$BUILD"
rm -rf "$TMP"

for addon in ${addons[@]}; do
echo "Packing addon ${addon}"
zip -r "build/${addon}.v${version}.zip" "addons/${addon}"

addon_tmp="$TMP/${addon}.v${version}/addons"
addon_src="$ROOT/addons/${addon}"
addon_dst="$BUILD/${addon}.v${version}"

mkdir -p "${addon_tmp}"
cp -r "${addon_src}" "${addon_tmp}"

cd "$TMP"
zip -r "${addon_dst}.zip" "${addon}.v${version}"

if [ "$addon" != "netfox" ]; then
zip -r "build/${addon}.with-deps.v${version}.zip" "addons/${addon}" "addons/netfox"
cp -r "$ROOT/addons/netfox" "${addon_tmp}"
zip -r "${addon_dst}.with-deps.zip" "${addon}.v${version}"
fi
rm -rf "tmp"

cd "$ROOT"
done

# Build example game
Expand Down

0 comments on commit 4d68e41

Please sign in to comment.