Skip to content

Commit

Permalink
cleaned up nasher scripts, fixed some batch and bash scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
b5635 committed Nov 3, 2024
1 parent b9e325d commit e04155f
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 124 deletions.
20 changes: 11 additions & 9 deletions linux_nasher_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ echo "It will automatically continue if you do not have module built (clean slat
echo
echo "WARNING: Continuing will rebuild the module from source, deleting all unsaved changes! Commit or stash your changes, or exit out."

rm -rf .build/modules/TFN
rm -rf .build/modules

mkdir -p .build
Expand All @@ -18,6 +17,16 @@ cp -r override .build/override
mkdir -p .build/database
mkdir -p .build/movies
mkdir -p .build/modules
mkdir -p .build/config

rm .build/docker-compose-dev.yml
cp docker-compose-dev.yml .build/docker-compose-dev.yml

rm .build/docker-compose-dev-seed.yml
cp docker-compose-dev-seed.yml .build/docker-compose-dev-seed.yml

rm .build/config/common.env
cp config/common.env .build/config/common.env

# Delete existing databases
rm .build/database/spawns.sqlite3
Expand All @@ -35,12 +44,5 @@ $PWD/tools/linux/sqlite/sqlite3 .build/database/spawns.sqlite3 < seeded_database
$PWD/tools/linux/sqlite/sqlite3 .build/database/areadistances.sqlite3 < seeded_database/areadistances.txt

cp movies/prelude.wbm .build/movies/prelude.wbm
cp nasher.cfg .build/nasher.cfg

rm TFN.mod

cd .build

$PWD/../tools/linux/nasher/nasher install --verbose --erfUtil:"$PWD/../tools/linux/neverwinter/nwn_erf" --gffUtil:"$PWD/../tools/linux/neverwinter/nwn_gff" --tlkUtil:"$PWD/../tools/linux/neverwinter/nwn_tlk" --nssCompiler:"$PWD/../tools/linux/nwnsc/nwnsc" --installDir:"$PWD" --nssFlags:"-oe -i $PWD/../nwn-base-scripts" --yes

rm TFN.mod
$PWD/tools/linux/nasher/nasher install --verbose --erfUtil:"$PWD/tools/linux/neverwinter/nwn_erf" --gffUtil:"$PWD/tools/linux/neverwinter/nwn_gff" --tlkUtil:"$PWD/tools/linux/neverwinter/nwn_tlk" --nssCompiler:"$PWD/tools/linux/nwnsc/nwnsc" --installDir:"$PWD/.build" --nssFlags:"-oe -i $PWD/nwn-base-scripts" --yes
5 changes: 5 additions & 0 deletions linux_nasher_unpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

$PWD/tools/linux/nasher/nasher unpack --file:.build/modules/TFN.mod --removeDeleted --erfUtil:"$PWD/tools/linux/neverwinter/nwn_erf" --gffUtil:"$PWD/tools/linux/neverwinter/nwn_gff" --tlkUtil:"$PWD/tools/linux/neverwinter/nwn_tlk" --nssFlags:"-l"
git rm --cached src -r
git add .
5 changes: 0 additions & 5 deletions linux_nasher_unpack_folder.sh

This file was deleted.

7 changes: 1 addition & 6 deletions linux_run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ hash=${hash:0:6}
desc="$desc
Last Updated: $timestamp ($hash)"

cd .build
$PWD/../tools/linux/nasher/nasher install --clean --erfUtil:"$PWD/../tools/linux/neverwinter/nwn_erf" --gffUtil:"$PWD/../tools/linux/neverwinter/nwn_gff" --tlkUtil:"$PWD/../tools/linux/neverwinter/nwn_tlk" --nssCompiler:"$PWD/../tools/linux/nwnsc/nwnsc" --installDir:"$PWD" --nssFlags:"-oe -i $PWD/../nwn-base-scripts" --no --modDescription="$desc"
$PWD/tools/linux/nasher/nasher install --clean --erfUtil:"$PWD/tools/linux/neverwinter/nwn_erf" --gffUtil:"$PWD/tools/linux/neverwinter/nwn_gff" --tlkUtil:"$PWD/tools/linux/neverwinter/nwn_tlk" --nssCompiler:"$PWD/tools/linux/nwnsc/nwnsc" --installDir:"$PWD/.build" --nssFlags:"-oe -i $PWD/nwn-base-scripts" --no --modDescription="$desc"

if [[ ! -f TFN.mod ]] ; then
echo 'Module does not exist, aborting.'
exit
fi

cd ..

# rm server/config/common.env
rm server/modules/TFN.mod
rm -d -R server/override
Expand Down Expand Up @@ -65,8 +62,6 @@ $PWD/tools/linux/sqlite/sqlite3 server/database/areadistances.sqlite3 < seeded_d
cp server/env/env.2da server/override/env.2da
cp server/env/env_dm.2da server/override/env_dm.2da

rm TFN.mod

cd server
docker-compose down
docker-compose up --no-recreate -d
8 changes: 0 additions & 8 deletions linux_run_server_dev.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/bin/bash

mkdir -p .build/config

rm .build/docker-compose-dev.yml
cp docker-compose-dev.yml .build/docker-compose-dev.yml

rm .build/config/common.env
cp config/common.env .build/config/common.env

cd .build

docker-compose -f docker-compose-dev.yml down
Expand Down
7 changes: 0 additions & 7 deletions linux_run_server_dev_seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ rm .build/database/areadistances.sqlite3
rm .build/database/tmapsolutions.sqlite3

mkdir -p .build/database
mkdir -p .build/config

# Delete existing databases, because sqlite will attempt to load it into an existing database instead of overwriting
rm .build/database/spawns.sqlite3
Expand All @@ -22,12 +21,6 @@ $PWD/tools/linux/sqlite/sqlite3 .build/database/randspellbooks.sqlite3 < seeded_
$PWD/tools/linux/sqlite/sqlite3 .build/database/prettify.sqlite3 < seeded_database/prettify.txt
$PWD/tools/linux/sqlite/sqlite3 .build/database/areadistances.sqlite3 < seeded_database/areadistances.txt

rm .build/docker-compose-dev-seed.yml
cp docker-compose-dev-seed.yml .build/docker-compose-dev-seed.yml

rm .build\config\common.env
cp config/common.env .build/config/common.env

cd .build

docker-compose -f docker-compose-dev-seed.yml down
Expand Down
13 changes: 4 additions & 9 deletions nasher.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ url = ""
author = ""

[Sources]
include = "../src/**/*.{nss,json}"
include = "src/**/*.{nss,json}"

[Rules]
"*" = "../src/$ext"
"*" = "src/$ext"

[Target]
name = "mod"
file = "TFN.mod"
description = ""

[Target]
name = "slim"
file = "TFN.mod"
filter = "*.{nss,ndb,gic}"
file = ".build/modules/TFN.mod"
description = ""
19 changes: 11 additions & 8 deletions win_nasher_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ echo WARNING: Continuing will rebuild the module from source, deleting all unsav
@echo on

del .build\modules /S
rd .build\modules\TFN
rd .build\modules

md .build
Expand All @@ -19,6 +18,16 @@ robocopy override .build\override
md .build\database
md .build\movies
md .build\modules
md .build\config

del /f .build\docker-compose-dev.yml
copy docker-compose-dev.yml .build\docker-compose-dev.yml

del /f .build\docker-compose-dev-seed.yml
copy docker-compose-dev-seed.yml .build\docker-compose-dev-seed.yml

del /f .build\config\common.env
copy config\common.env .build\config\common.env

:: Delete existing databases, because sqlite will attempt to load it into an existing database instead of overwriting
del /f .build\database\spawns.sqlite3
Expand All @@ -36,13 +45,7 @@ del /f .build\database\areadistances.sqlite3
"%CD%/tools/win/sqlite/sqlite3.exe" .build/database/areadistances.sqlite3 < seeded_database/areadistances.txt

copy movies\prelude.wbm .build\movies\prelude.wbm
copy nasher.cfg .build\nasher.cfg

del /f TFN.mod

cd .build

"%CD%/../tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/../tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/../tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/../tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/../tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/../nwn-base-scripts""" --no
"%CD%/tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%/.build" --nssFlags:"-oe -i ""%CD%/nwn-base-scripts""" --no

del /f TFN.mod
pause
48 changes: 0 additions & 48 deletions win_nasher_install_clean.bat

This file was deleted.

3 changes: 3 additions & 0 deletions win_nasher_unpack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"%CD%/tools/win/nasher/nasher.exe" unpack --file:.build/modules/TFN.mod --removeDeleted --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssFlags:"-l"
git rm --cached src -r
git add .
3 changes: 0 additions & 3 deletions win_nasher_unpack_folder.bat

This file was deleted.

9 changes: 1 addition & 8 deletions win_run_server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ echo WARNING: Continuing will rebuild the module from source, deleting all unsav
@echo on

del .build\modules /S
rd .build\modules\TFN
rd .build\modules

md .build
Expand All @@ -37,11 +36,7 @@ set "content=!content!Last Updated: %timestamp% (%hash%)"

endlocal

cd .build

"%CD%/../tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/../tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/../tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/../tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/../tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%" --nssFlags:"-oe -i ""%CD%/../nwn-base-scripts""" --no --modDescription "!content!"

cd ..
"%CD%/tools/win/nasher/nasher.exe" install --verbose --erfUtil:"%CD%/tools/win/neverwinter64/nwn_erf.exe" --gffUtil:"%CD%/tools/win/neverwinter64/nwn_gff.exe" --tlkUtil:"%CD%/tools/win/neverwinter64/nwn_tlk.exe" --nssCompiler:"%CD%/tools/win/nwnsc/nwnsc.exe" --installDir:"%CD%/.build" --nssFlags:"-oe -i ""%CD%/nwn-base-scripts""" --no --modDescription "!content!"

del /f server\config\common.env
del /f server\modules\TFN.mod
Expand Down Expand Up @@ -80,8 +75,6 @@ robocopy override server\override
copy server\env\env.2da server\override\env.2da
copy server\env\env_dm.2da server\override\env_dm.2da

del /f .build\TFN.mod

cd server
docker-compose -f docker-compose.yml down
docker-compose -f docker-compose.yml up --no-recreate -d
Expand Down
6 changes: 0 additions & 6 deletions win_run_server_dev.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
del /f .build\docker-compose-dev.yml
copy docker-compose-dev.yml .build\docker-compose-dev.yml

del /f .build\config\common.env
copy config\common.env .build\config\common.env

cd .build

docker-compose -f docker-compose-dev.yml down
Expand Down
7 changes: 0 additions & 7 deletions win_run_server_dev_seed.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ del /f .build\database\tmapsolutions.sqlite3
del /f .build\database\areadistances.sqlite3

md .build\database
md .build\config

:: Delete existing databases, because sqlite will attempt to load it into an existing database instead of overwriting
del /f .build\database\spawns.sqlite3
Expand All @@ -30,12 +29,6 @@ del /f .build\database\areadistances.sqlite3
"%CD%/tools/win/sqlite/sqlite3.exe" .build/database/prettify.sqlite3 < seeded_database/prettify.txt
"%CD%/tools/win/sqlite/sqlite3.exe" .build/database/areadistances.sqlite3 < seeded_database/areadistances.txt

del /f .build\docker-compose-dev-seed.yml
copy docker-compose-dev-seed.yml .build\docker-compose-dev-seed.yml

del /f .build\config\common.env
copy config\common.env .build\config\common.env

cd .build

docker-compose -f docker-compose-dev-seed.yml down
Expand Down

0 comments on commit e04155f

Please sign in to comment.