From 83c379213090189243e77e5e5919c238efb435cc Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Sat, 7 May 2022 13:49:49 +0200 Subject: [PATCH] use tauri cli directly if no runner is given --- action.yml | 2 +- src/build-project.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index ae544b4..6deea60 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ name: 'tauri-build' description: 'Build tauri binaries for MacOS, Windows and Linux' -icon: 'download-cloud' +icon: 'box' color: 'blue' author: 'Tauri Programme within The Commons Conservancy' inputs: diff --git a/src/build-project.ts b/src/build-project.ts index b748d4f..1d9a26c 100644 --- a/src/build-project.ts +++ b/src/build-project.ts @@ -1,3 +1,4 @@ +import { run } from '@tauri-apps/cli' import {execa} from 'execa' import {join} from 'path' import glob from 'tiny-glob' @@ -13,7 +14,7 @@ interface BuildOptions { export async function buildProject(options: BuildOptions): Promise { const projectPath = options.configPath || process.cwd() - const runner = options.runner || 'tauri' + let args: string[] = options.args || [] if (options.configPath) { @@ -24,7 +25,13 @@ export async function buildProject(options: BuildOptions): Promise { 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 outDir = options.target