-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
LOGFILE=./build.log | ||
|
||
echo "" > $LOGFILE | ||
|
||
echo "Starting build process" | tee -a $LOGFILE | ||
|
||
rm -rf ./build | ||
rm -rf ./compiled | ||
mkdir ./build | ||
mkdir ./compiled | ||
|
||
echo "Directories cleaned and new ones created" | tee -a $LOGFILE | ||
|
||
find . -name "*.lua" -type f ! -path "./compiled/*" ! -path "./.luarocks/*" | while read -r file | ||
do | ||
# Extract the base name of the file | ||
base=$(basename "$file") | ||
|
||
# Check if a file with the same name already exists in the build directory | ||
if [ -e "./build/$base" ]; then | ||
echo "Error: File $base already exists in the build directory. Exiting." | ||
echo "Error: File $base already exists in the build directory. Exiting." | tee -a $LOGFILE | ||
exit 1 | ||
else | ||
# If not, copy the file to the build directory | ||
cp "$file" ./build | ||
echo "Copied $file to build directory" | tee -a $LOGFILE | ||
fi | ||
done | ||
|
||
# copy everything from src/resources too | ||
cp -r ./src/resources/* ./build | ||
cp -r ./src/resources/* ./build | ||
echo "Copied resources to build directory" | tee -a $LOGFILE | ||
|
||
echo "Build process completed" | tee -a $LOGFILE |