mirror of
https://github.com/Lightcord/Lightcord.git
synced 2025-04-12 00:55:40 +02:00
no longer using bytenode, so we can just use node
This commit is contained in:
parent
67ee99454a
commit
943aadb29d
19
compile.js
19
compile.js
@ -5,13 +5,7 @@ const util = require("util")
|
||||
|
||||
const production = true
|
||||
|
||||
let electron
|
||||
try{
|
||||
electron = require("electron")
|
||||
}catch(e){
|
||||
electron = null
|
||||
}
|
||||
let fs = electron ? require("original-fs") : require("fs")
|
||||
let fs = require("fs")
|
||||
|
||||
console.log = (...args) => {
|
||||
process.stdout.write(Buffer.from(util.formatWithOptions({colors: true}, ...args)+"\n", "binary").toString("utf8"))
|
||||
@ -21,12 +15,10 @@ console.info = (...args) => {
|
||||
}
|
||||
|
||||
async function main(){
|
||||
if(electron)await electron.app.whenReady()
|
||||
|
||||
console.log(__dirname, process.cwd())
|
||||
|
||||
console.info("Reseting existent directory...")
|
||||
child_process.execSync("node remove.js") // why can't electron remove directory ? it just doesn't work and I am required to use electron for the .jsc compilation.
|
||||
await fs.promises.rmdir("./distApp", {"recursive": true})
|
||||
await fs.promises.mkdir(__dirname+"/distApp/dist", {"recursive": true})
|
||||
|
||||
console.info("Executing command `tsc`")
|
||||
@ -114,9 +106,4 @@ async function main(){
|
||||
cwd: path.join(__dirname, "distApp")
|
||||
}))
|
||||
}
|
||||
main()
|
||||
.then(() => {
|
||||
if(electron){
|
||||
electron.app.exit()
|
||||
}
|
||||
})
|
||||
main()
|
@ -7,8 +7,8 @@
|
||||
"test": "tsc && electron .",
|
||||
"run": "electron .",
|
||||
"build": "npm run build:minify && npm run build:electron",
|
||||
"build:electron": "electron-packager ./distApp --ignore=\"(distApp|builds|\\.ts)\" --arch=ia32 --win32metadata.ProductName=\"Lightcord\" --win32metadata.CompanyName=\"Lightcord Inc.\" --protocol=discord --platform=\"win32\" --out=builds --icon=app.ico --executable-name=\"Lightcord\" --asar.unpack=*.{node,dll} --overwrite",
|
||||
"build:minify": "electron compile.js",
|
||||
"build:electron": "electron-packager ./distApp --ignore=\"(distApp|builds|\\.ts)\" --arch=ia32 --win32metadata.ProductName=\"Lightcord\" --win32metadata.CompanyName=\"Lightcord Inc.\" --protocol=discord --platform=\"win32,linux\" --out=builds --icon=app.ico --executable-name=\"Lightcord\" --asar.unpack=*.{node,dll} --overwrite",
|
||||
"build:minify": "node compile.js",
|
||||
"devInstall": "npm i -g --arch=ia32 electron@8.3.0 && npm i -g typescript && npm i --save-dev @types/node@12.12.39 && npm i --save-dev --arch=ia32 electron@8.3.0 && node installSubModules.js && echo \"Everything is installed. You should be able to do `npm run test` to compile everything and launch.\""
|
||||
},
|
||||
"author": "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user