mirror of
https://github.com/JonasKruckenberg/tauri-build.git
synced 2025-08-15 05:15:06 +00:00
Fix some eslint issues
This commit is contained in:
parent
07247e9b95
commit
dd085ee7ed
@ -124,14 +124,14 @@ async function spawnCmd(
|
|||||||
args: string[],
|
args: string[],
|
||||||
options: SpawnOptionsWithoutStdio = {}
|
options: SpawnOptionsWithoutStdio = {}
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((spawn_resolve, reject) => {
|
||||||
const child = spawn(cmd, args, {
|
const child = spawn(cmd, args, {
|
||||||
...options,
|
...options,
|
||||||
stdio: ['pipe', 'inherit', 'inherit'],
|
stdio: ['pipe', 'inherit', 'inherit'],
|
||||||
shell: true
|
shell: true
|
||||||
})
|
})
|
||||||
|
|
||||||
child.on('exit', () => resolve)
|
child.on('exit', () => spawn_resolve)
|
||||||
|
|
||||||
child.on('error', error => {
|
child.on('error', error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
@ -150,20 +150,20 @@ async function execCmd(
|
|||||||
args: string[],
|
args: string[],
|
||||||
options: Omit<ExecOptionsWithStringEncoding, 'encoding'> = {}
|
options: Omit<ExecOptionsWithStringEncoding, 'encoding'> = {}
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((exe_resolve, reject) => {
|
||||||
exec(
|
exec(
|
||||||
`${cmd} ${args.join(' ')}`,
|
`${cmd} ${args.join(' ')}`,
|
||||||
{...options, encoding: 'utf-8'},
|
{...options, encoding: 'utf-8'},
|
||||||
(error, stdout, stderr) => {
|
(error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(
|
core.error(
|
||||||
`Failed to execute cmd ${cmd} with args: ${args.join(
|
`Failed to execute cmd ${cmd} with args: ${args.join(
|
||||||
' '
|
' '
|
||||||
)}. reason: ${error}`
|
)}. reason: ${error}`
|
||||||
)
|
)
|
||||||
reject(stderr)
|
reject(stderr)
|
||||||
} else {
|
} else {
|
||||||
resolve(stdout)
|
exe_resolve(stdout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user