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
17
compile.js
17
compile.js
@ -5,13 +5,7 @@ const util = require("util")
|
|||||||
|
|
||||||
const production = true
|
const production = true
|
||||||
|
|
||||||
let electron
|
let fs = require("fs")
|
||||||
try{
|
|
||||||
electron = require("electron")
|
|
||||||
}catch(e){
|
|
||||||
electron = null
|
|
||||||
}
|
|
||||||
let fs = electron ? require("original-fs") : require("fs")
|
|
||||||
|
|
||||||
console.log = (...args) => {
|
console.log = (...args) => {
|
||||||
process.stdout.write(Buffer.from(util.formatWithOptions({colors: true}, ...args)+"\n", "binary").toString("utf8"))
|
process.stdout.write(Buffer.from(util.formatWithOptions({colors: true}, ...args)+"\n", "binary").toString("utf8"))
|
||||||
@ -21,12 +15,10 @@ console.info = (...args) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main(){
|
async function main(){
|
||||||
if(electron)await electron.app.whenReady()
|
|
||||||
|
|
||||||
console.log(__dirname, process.cwd())
|
console.log(__dirname, process.cwd())
|
||||||
|
|
||||||
console.info("Reseting existent directory...")
|
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})
|
await fs.promises.mkdir(__dirname+"/distApp/dist", {"recursive": true})
|
||||||
|
|
||||||
console.info("Executing command `tsc`")
|
console.info("Executing command `tsc`")
|
||||||
@ -115,8 +107,3 @@ async function main(){
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
main()
|
main()
|
||||||
.then(() => {
|
|
||||||
if(electron){
|
|
||||||
electron.app.exit()
|
|
||||||
}
|
|
||||||
})
|
|
@ -7,8 +7,8 @@
|
|||||||
"test": "tsc && electron .",
|
"test": "tsc && electron .",
|
||||||
"run": "electron .",
|
"run": "electron .",
|
||||||
"build": "npm run build:minify && npm run build: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: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": "electron compile.js",
|
"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.\""
|
"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": "",
|
"author": "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user