mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-17 07:34:15 -06:00
fix: aggressively run fix-htaccess.js in all build lifecycles and add comment bypass to trick hostinger
This commit is contained in:
parent
13ffb16952
commit
10f2863aa4
|
|
@ -5,7 +5,7 @@
|
|||
"description": "Cross-cutting tooling for ScreenTinker shared assets (transition shader library, etc.)",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "npm install --prefix server",
|
||||
"build": "npm install --prefix server && node scripts/fix-htaccess.js",
|
||||
"postinstall": "node scripts/fix-htaccess.js",
|
||||
"build:manifest": "node shared/Transitions/generate-manifest.js",
|
||||
"test:shaders": "node shared/Transitions/compile-test.js"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,12 @@ for (const htaccessPath of possiblePaths) {
|
|||
// Remove the offending line completely
|
||||
content = content.replace(/^.*SetEnv NODE_OPTIONS.*$/gm, '');
|
||||
|
||||
fs.writeFileSync(htaccessPath, content.trim() + '\n', 'utf8');
|
||||
// Add a commented-out version to trick Hostinger's auto-injector into thinking it's already there
|
||||
if (!content.includes('# SetEnv NODE_OPTIONS --use-openssl-ca')) {
|
||||
content = content.trim() + '\n# SetEnv NODE_OPTIONS --use-openssl-ca\n';
|
||||
}
|
||||
|
||||
fs.writeFileSync(htaccessPath, content, 'utf8');
|
||||
console.log(`[fix-htaccess] Successfully removed SetEnv NODE_OPTIONS!`);
|
||||
fixed = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
"scripts": {
|
||||
"start": "node --env-file-if-exists=.env server.js",
|
||||
"dev": "node --watch --env-file-if-exists=.env server.js",
|
||||
"test": "node --test --test-concurrency=2"
|
||||
"test": "node --test --test-concurrency=2",
|
||||
"postinstall": "node ../scripts/fix-htaccess.js || true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/msal-node": "^5.2.1",
|
||||
|
|
|
|||
Loading…
Reference in a new issue