mirror of
https://github.com/JonasKruckenberg/tauri-build.git
synced 2025-08-14 21:05:05 +00:00
use tauri cli directly if no runner is given
This commit is contained in:
parent
61297088b7
commit
83c3792130
@ -1,6 +1,6 @@
|
|||||||
name: 'tauri-build'
|
name: 'tauri-build'
|
||||||
description: 'Build tauri binaries for MacOS, Windows and Linux'
|
description: 'Build tauri binaries for MacOS, Windows and Linux'
|
||||||
icon: 'download-cloud'
|
icon: 'box'
|
||||||
color: 'blue'
|
color: 'blue'
|
||||||
author: 'Tauri Programme within The Commons Conservancy'
|
author: 'Tauri Programme within The Commons Conservancy'
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { run } from '@tauri-apps/cli'
|
||||||
import {execa} from 'execa'
|
import {execa} from 'execa'
|
||||||
import {join} from 'path'
|
import {join} from 'path'
|
||||||
import glob from 'tiny-glob'
|
import glob from 'tiny-glob'
|
||||||
@ -13,7 +14,7 @@ interface BuildOptions {
|
|||||||
|
|
||||||
export async function buildProject(options: BuildOptions): Promise<string[]> {
|
export async function buildProject(options: BuildOptions): Promise<string[]> {
|
||||||
const projectPath = options.configPath || process.cwd()
|
const projectPath = options.configPath || process.cwd()
|
||||||
const runner = options.runner || 'tauri'
|
|
||||||
let args: string[] = options.args || []
|
let args: string[] = options.args || []
|
||||||
|
|
||||||
if (options.configPath) {
|
if (options.configPath) {
|
||||||
@ -24,7 +25,13 @@ export async function buildProject(options: BuildOptions): Promise<string[]> {
|
|||||||
args.push('--target', options.target)
|
args.push('--target', options.target)
|
||||||
}
|
}
|
||||||
|
|
||||||
await execa(runner, args, {cwd: projectPath, stdio: 'inherit'})
|
process.chdir(projectPath)
|
||||||
|
|
||||||
|
if (options.runner) {
|
||||||
|
await execa(options.runner, args, { stdio: 'inherit' })
|
||||||
|
} else {
|
||||||
|
await run(args, '')
|
||||||
|
}
|
||||||
|
|
||||||
const profile = options.debug ? 'debug' : 'release'
|
const profile = options.debug ? 'debug' : 'release'
|
||||||
const outDir = options.target
|
const outDir = options.target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user