diff --git a/other/fsolauncher-remeshes/build.js b/other/fsolauncher-remeshes/build.js index b6e8c7e..74e312a 100644 --- a/other/fsolauncher-remeshes/build.js +++ b/other/fsolauncher-remeshes/build.js @@ -1,18 +1,26 @@ const fs = require( 'fs' ); const archiver = require( 'archiver' ); const path = require( 'path' ); -const { execSync } = require('child_process'); +const { execSync } = require( 'child_process' ); + +console.log( "Starting build script..." ); // Read package.json +console.log( "Reading package.json..." ); const packageJson = require( './package.json' ); const version = packageJson.version; +console.log( `Version: ${version}` ); // Execute the timestamp.sh script and parse its output +console.log( "Executing timestamp.sh script..." ); const timestampOutput = execSync( 'bash timestamp.sh' ).toString().trim(); +console.log( `timestamp.sh output: ${timestampOutput}` ); const timestamp = timestampOutput.split(' ')[0]; // Timestamp is the first part of the output +console.log( `Extracted timestamp: ${timestamp}` ); // Output file const outputFilename = `remeshes-${version}-${timestamp}.zip`; +console.log( `Output filename: ${outputFilename}` ); const output = fs.createWriteStream( path.join( __dirname, `../../release/${outputFilename}` ) ); const archive = archiver( 'zip', { zlib: { level: 9 } // Compression level @@ -25,13 +33,17 @@ output.on( 'close', function () { } ); // Catch errors -archive.on( 'error', function ( err ) { +archive.on( 'error', function ( err ) { + console.error( "Archive error:", err ); throw err; } ); // Zip the directory +console.log( "Zipping the directory..." ); archive.directory( 'remeshes/', false ); // Finalize the archive +console.log( "Finalizing the archive..." ); archive.pipe( output ); -archive.finalize(); \ No newline at end of file +archive.finalize(); +console.log( "Build script completed." ); diff --git a/other/fsolauncher-remeshes/timestamp.sh b/other/fsolauncher-remeshes/timestamp.sh index 9592ab5..81ef3da 100644 --- a/other/fsolauncher-remeshes/timestamp.sh +++ b/other/fsolauncher-remeshes/timestamp.sh @@ -1,11 +1,21 @@ #!/bin/bash -# Get the latest timestamp from the remesh files +# Redirect debug output to stderr +echo "Starting timestamp.sh script..." >&2 + +echo "Running git log to get timestamps..." >&2 git log --format="%at %H" --name-only --reverse -- remeshes | awk ' - /^[0-9]+/ { timestamp=$1; next } - { files[$0]=timestamp } + /^[0-9]+/ { + timestamp=$1; + next + } + { + files[$0]=timestamp + } END { for (file in files) { print files[file] " " file } - }' | sort -rn | head -n 1 \ No newline at end of file + }' | sort -rn | head -n 1 + +echo "timestamp.sh script finished." >&2