mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-09 01:31:46 +00:00
* feat(synced-lyrics): init romanization! * remove debug logs and add TODO * feat(synced-lyrics/romanization): Mandarin! * feat(synced-lyrics/romanization): improve japanese detection * feat(synced-lyrics/romanization): Korean! * qol(synced-lyrics/romanization): canonicalize punctuation and symbols * feat(synced-lyrics/romanization): handle japanese+korean and korean+chinese lyrics * revert formatting on electron.vite.config.mts * feat(synced-lyrics/romanization): romanize plain lyrics * apply fix by @kimjammer * fix lockfile due to rebase * feat(synced-lyrics): improve lyric processing and formatting; * feat(synced-lyrics/romanization): add option to enable/disable romanization * chore: move default value for --lyrics-duration to the declaration * update lockfile * fix: improvement 1. improved language detection logic 2. changed code to work in the renderer process * fix: fix regression (canonicalize) --------- Co-authored-by: JellyBrick <shlee1503@naver.com>
30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
diff --git a/index.js b/index.js
|
|
index 5968fcf47b69094993b0f861c03f5560e4a6a9b7..0fe16d4f40612c0abfa57898909ce0083f56944c 100644
|
|
--- a/index.js
|
|
+++ b/index.js
|
|
@@ -56,19 +56,23 @@ function getOptionsWithDefaults (options, manifest) {
|
|
async function spawnWithLogging (options, command, args, allowFail) {
|
|
return new Promise((resolve, reject) => {
|
|
logger(`$ ${command} ${args.join(' ')}`)
|
|
+ const output = []
|
|
const child = childProcess.spawn(command, args, { cwd: options['working-dir'] })
|
|
child.stdout.on('data', (data) => {
|
|
+ output.push(data)
|
|
logger(`1> ${data}`)
|
|
})
|
|
child.stderr.on('data', (data) => {
|
|
+ output.push(data)
|
|
logger(`2> ${data}`)
|
|
})
|
|
child.on('error', (error) => {
|
|
+ logger(`error - ${error.message} ${error.stack}`)
|
|
reject(error)
|
|
})
|
|
child.on('close', (code) => {
|
|
if (!allowFail && code !== 0) {
|
|
- reject(new Error(`${command} failed with status code ${code}`))
|
|
+ reject(new Error(`${command} ${args.join(' ')} failed with status code ${code} ${output.join(' ')}`))
|
|
}
|
|
resolve(code === 0)
|
|
})
|