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/postinstall.js b/scripts/postinstall.js index 4d8e415..82b8a57 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -12,29 +12,35 @@ 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 +48,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: 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