From 4ebcea3d047c6b4246c9183bb3ce5e871ecdfbd1 Mon Sep 17 00:00:00 2001 From: Ethan Mahlstedt Date: Fri, 9 May 2025 19:03:11 -0700 Subject: [PATCH 1/3] Fix PostInstall.js --- scripts/postinstall.js | 94 +++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 4d8e415..20afff5 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -12,29 +12,33 @@ switch (platform) { // macOS specific code switch (arch) { case "x64": { - const scripts = fs.readdirSync( - path.join(__dirname, "darwin-x64", "postinstall") - ); - scripts.forEach((script) => { - if (script.endsWith(".js")) { - require( - path.join(__dirname, "darwin-x64", "postinstall", script) - )(); - } - }); + if(fs.existsSync(path.join(__dirname, "darwin-x64", "postinstall"))) { + const scripts = fs.readdirSync( + path.join(__dirname, "darwin-x64", "postinstall") + ); + scripts.forEach((script) => { + if (script.endsWith(".js")) { + require( + path.join(__dirname, "darwin-x64", "postinstall", script) + )(); + } + }); + }else return; break; } case "arm64": { - const scripts = fs.readdirSync( - path.join(__dirname, "darwin-arm64", "postinstall") - ); - scripts.forEach((script) => { - if (script.endsWith(".js")) { - require( - path.join(__dirname, "darwin-arm64", "postinstall", script) - )(); - } - }); + if(fs.existsSync(path.join(__dirname, "darwin-arm64", "postinstall"))) { + const scripts = fs.readdirSync( + path.join(__dirname, "darwin-arm64", "postinstall") + ); + scripts.forEach((script) => { + if (script.endsWith(".js")) { + require( + path.join(__dirname, "darwin-arm64", "postinstall", script) + )(); + } + }); + }else return; break; } default: @@ -42,32 +46,36 @@ switch (platform) { } break; case "linux": { - const scripts = fs.readdirSync( - path.join(__dirname, "linux", "postinstall") - ); - scripts.forEach((script) => { - if (script.endsWith(".js")) { - require(path.join(__dirname, "linux", "postinstall", script))(); - } else if (script.endsWith(".sh")) { - execSync( - `chmod +x ${path.join(__dirname, "linux", "postinstall", script)}` - ); - execSync(`${path.join(__dirname, "linux", "postinstall", script)}`); - } - }); + if(fs.existsSync(path.join(__dirname, "linux", "postinstall"))) { + const scripts = fs.readdirSync( + path.join(__dirname, "linux", "postinstall") + ); + scripts.forEach((script) => { + if (script.endsWith(".js")) { + require(path.join(__dirname, "linux", "postinstall", script))(); + } else if (script.endsWith(".sh")) { + execSync( + `chmod +x ${path.join(__dirname, "linux", "postinstall", script)}` + ); + execSync(`${path.join(__dirname, "linux", "postinstall", script)}`); + } + }); + }else return; break; } case "win32": { - const scripts = fs.readdirSync( - path.join(__dirname, "win32", "postinstall") - ); - scripts.forEach((script) => { - if (script.endsWith(".js")) { - require(path.join(__dirname, "win32", "postinstall", script))(); - } else if (script.endsWith(".bat")) { - execSync(`${path.join(__dirname, "win32", "postinstall", script)}`); - } - }); + if(fs.existsSync(path.join(__dirname, "win32", "postinstall"))) { + const scripts = fs.readdirSync( + path.join(__dirname, "win32", "postinstall") + ); + scripts.forEach((script) => { + if (script.endsWith(".js")) { + require(path.join(__dirname, "win32", "postinstall", script))(); + } else if (script.endsWith(".bat")) { + execSync(`${path.join(__dirname, "win32", "postinstall", script)}`); + } + }); + }else return; break; } default: From 0575db144f8ffd4eac21362451443894b8a08d03 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 10 May 2025 02:04:30 +0000 Subject: [PATCH 2/3] WF: Lint and Prettier: Fix postinstall.js --- scripts/postinstall.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 20afff5..82b8a57 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -12,7 +12,7 @@ switch (platform) { // macOS specific code switch (arch) { case "x64": { - if(fs.existsSync(path.join(__dirname, "darwin-x64", "postinstall"))) { + if (fs.existsSync(path.join(__dirname, "darwin-x64", "postinstall"))) { const scripts = fs.readdirSync( path.join(__dirname, "darwin-x64", "postinstall") ); @@ -23,11 +23,13 @@ switch (platform) { )(); } }); - }else return; + } else return; break; } case "arm64": { - if(fs.existsSync(path.join(__dirname, "darwin-arm64", "postinstall"))) { + if ( + fs.existsSync(path.join(__dirname, "darwin-arm64", "postinstall")) + ) { const scripts = fs.readdirSync( path.join(__dirname, "darwin-arm64", "postinstall") ); @@ -38,7 +40,7 @@ switch (platform) { )(); } }); - }else return; + } else return; break; } default: @@ -46,7 +48,7 @@ switch (platform) { } break; case "linux": { - if(fs.existsSync(path.join(__dirname, "linux", "postinstall"))) { + if (fs.existsSync(path.join(__dirname, "linux", "postinstall"))) { const scripts = fs.readdirSync( path.join(__dirname, "linux", "postinstall") ); @@ -60,11 +62,11 @@ switch (platform) { execSync(`${path.join(__dirname, "linux", "postinstall", script)}`); } }); - }else return; + } else return; break; } case "win32": { - if(fs.existsSync(path.join(__dirname, "win32", "postinstall"))) { + if (fs.existsSync(path.join(__dirname, "win32", "postinstall"))) { const scripts = fs.readdirSync( path.join(__dirname, "win32", "postinstall") ); @@ -75,7 +77,7 @@ switch (platform) { execSync(`${path.join(__dirname, "win32", "postinstall", script)}`); } }); - }else return; + } else return; break; } default: From 6cbc6299ac191e308aa4d08020bd114a9db88c8f Mon Sep 17 00:00:00 2001 From: Ethan Mahlstedt Date: Sat, 10 May 2025 11:10:43 -0700 Subject: [PATCH 3/3] Update Scripts --- TODOs | 7 ------- scripts/win32/build.bat | 4 +++- scripts/win32/install.bat | 4 +++- scripts/win32/launch.bat | 4 +++- scripts/win32/lineCount.bat | 4 +++- scripts/win32/lint.bat | 4 +++- scripts/win32/pretty.bat | 4 +++- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/TODOs b/TODOs index 8cb6d30..8b8217d 100644 --- a/TODOs +++ b/TODOs @@ -1,10 +1,3 @@ -= for VERSION 1.0 = - Branding - Create README - -BUGS: - Blank lines counted as double at the end of the file - = for VERSION 1.1 = Save last state of the editor upon close Dynamic Skins diff --git a/scripts/win32/build.bat b/scripts/win32/build.bat index 9dda51e..4ee673f 100644 --- a/scripts/win32/build.bat +++ b/scripts/win32/build.bat @@ -1,4 +1,6 @@ @echo off cd .. cd .. -npx electron-builder \ No newline at end of file +npx electron-builder +cd scripts +cd win32 \ No newline at end of file diff --git a/scripts/win32/install.bat b/scripts/win32/install.bat index 6f325f2..7bea6da 100644 --- a/scripts/win32/install.bat +++ b/scripts/win32/install.bat @@ -1,4 +1,6 @@ @echo off cd .. cd .. -npm i \ No newline at end of file +npm i +cd scripts +cd win32 \ No newline at end of file diff --git a/scripts/win32/launch.bat b/scripts/win32/launch.bat index 5a52753..166e6a4 100644 --- a/scripts/win32/launch.bat +++ b/scripts/win32/launch.bat @@ -1,4 +1,6 @@ @echo off cd .. cd .. -npm start \ No newline at end of file +npm start +cd scripts +cd win32 \ No newline at end of file diff --git a/scripts/win32/lineCount.bat b/scripts/win32/lineCount.bat index 796d1af..b25a061 100644 --- a/scripts/win32/lineCount.bat +++ b/scripts/win32/lineCount.bat @@ -1,4 +1,6 @@ @echo off cd .. cd .. -cloc modules front filePresets main.js \ No newline at end of file +cloc modules front filePresets main.js scripts +cd scripts +cd win32 \ No newline at end of file diff --git a/scripts/win32/lint.bat b/scripts/win32/lint.bat index d5dc0d7..5aef4d3 100644 --- a/scripts/win32/lint.bat +++ b/scripts/win32/lint.bat @@ -1,4 +1,6 @@ @echo off cd .. cd .. -npx eslint . \ No newline at end of file +npx eslint . +cd scripts +cd win32 \ No newline at end of file diff --git a/scripts/win32/pretty.bat b/scripts/win32/pretty.bat index c02f43e..b06e4ee 100644 --- a/scripts/win32/pretty.bat +++ b/scripts/win32/pretty.bat @@ -1,4 +1,6 @@ @echo off cd .. cd .. -npx prettier . --write \ No newline at end of file +npx prettier . --write +cd scripts +cd win32 \ No newline at end of file