Skip to content

Commit

Permalink
fix: Windows 32 bit CI (Includes both ia32 and x64)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin969 committed Feb 23, 2024
1 parent dbc291a commit f3fbda2
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 21 deletions.
69 changes: 50 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"release:win32": "cross-env-shell NODE_ENV=production PUBLISH=true \"npm run build && npm run pack:win32\"",
"release:darwin": "cross-env-shell NODE_ENV=production PUBLISH=true \"npm run build && npm run pack:darwin\"",
"release:all": "cross-env-shell NODE_ENV=production PUBLISH=true \"npm run build && npm run pack:all\"",
"postinstall": "electron-builder install-app-deps & gulp extInstall",
"postinstall": "electron-builder install-app-deps & gulp extInstall & node postinstall.mjs",
"clean": "gulp clean"
},
"author": {
Expand All @@ -39,7 +39,7 @@
"@fortawesome/fontawesome-svg-core": "1.2.36",
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@fortawesome/react-fontawesome": "0.1.18",
"@fparchive/flashpoint-archive": "^0.3.0",
"@fparchive/flashpoint-archive": "0.4.3",
"@types/react-virtualized": "^9.21.21",
"axios": "1.3.4",
"connected-react-router": "6.9.2",
Expand Down
32 changes: 32 additions & 0 deletions postinstall.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { exec } from 'child_process';
import { platform } from 'os';

// Function to check if the current platform is Windows
function isWindows() {
return platform() === 'win32';
}

// Function to run npm install with specific architecture and force flag
function runNpmInstall() {
// Command to run npm install with architecture and force flag
const command = 'npm install --arch=ia32 --force --package-lock-only --ignore-scripts';

// Execute the command
exec(command, (error, stdout, stderr) => {
if (error) {
console.error(`Error running npm install: ${error.message}`);
return;
}
if (stderr) {
console.error(`stderr: ${stderr}`);
return;
}
console.log(`npm install output: ${stdout}`);
});
}

// Check if the platform is Windows and run npm install if true
if (isWindows()) {
console.log('Installing additional ia32 Windows libraries...');
runNpmInstall();
}

0 comments on commit f3fbda2

Please sign in to comment.