Skip to content

Commit b432cc6

Browse files
authored
Update index.js
1 parent 0acaa95 commit b432cc6

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

index.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@ const rl = createInterface(process.stdin, process.stdout)
1616

1717
async function runUpdaterByConfig() {
1818
if (global.config.cekupdate !== true) return
19-
2019
const logs = []
2120
const originalLog = console.log
22-
2321
console.log = (...args) => {
2422
logs.push({
2523
waktu: new Date().toLocaleTimeString(),
2624
pesan: args.join(' ')
2725
})
2826
originalLog(...args)
2927
}
30-
3128
try {
3229
await checkUpdate()
3330
} catch (e) {
@@ -36,9 +33,7 @@ async function runUpdaterByConfig() {
3633
pesan: e.message
3734
})
3835
}
39-
4036
console.log = originalLog
41-
4237
if (logs.length) {
4338
console.log('\n=== UPDATE LOG TABLE ===')
4439
console.table(logs)
@@ -78,40 +73,32 @@ let isRunning = false
7873
function start(file) {
7974
if (isRunning) return
8075
isRunning = true
81-
8276
const args = [join(__dirname, file), ...process.argv.slice(2)]
83-
8477
say([process.argv[0], ...args].join(' '), {
8578
font: 'console',
8679
align: 'center',
8780
colors: ['magenta']
8881
})
89-
9082
say('⸙ MEMUAT SOURCE...', {
9183
font: 'console',
9284
align: 'center',
9385
colors: ['blue']
9486
})
95-
9687
say('⸙ MEMUAT PLUGINS...', {
9788
font: 'console',
9889
align: 'center',
9990
colors: ['blue']
10091
})
101-
10292
say('✅ DONE !', {
10393
font: 'console',
10494
align: 'center',
10595
colors: ['green']
10696
})
107-
10897
setupMaster({
10998
exec: args[0],
11099
args: args.slice(1),
111100
})
112-
113101
const p = fork()
114-
115102
p.on('message', data => {
116103
console.log('[RECEIVED]', data)
117104
switch (data) {
@@ -125,7 +112,6 @@ function start(file) {
125112
break
126113
}
127114
})
128-
129115
p.on('exit', (_, code) => {
130116
isRunning = false
131117
if (code == 'SIGKILL' || code == 'SIGABRT') return start(file)
@@ -136,7 +122,6 @@ function start(file) {
136122
start(file)
137123
})
138124
})
139-
140125
const opts = yargs(process.argv.slice(2)).exitProcess(false).parse()
141126
if (!opts['test'] && !rl.listenerCount()) {
142127
rl.on('line', line => {

0 commit comments

Comments
 (0)