mirror of
https://github.com/JonasKruckenberg/tauri-build.git
synced 2025-08-15 05:15:06 +00:00
only change dir optionally
This commit is contained in:
parent
867e9d7bed
commit
5fa2b7e361
5
.changes/fix-optional-chdir.md
Normal file
5
.changes/fix-optional-chdir.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-build": patch
|
||||
---
|
||||
|
||||
Only change working directory when projectPath is given.
|
@ -2,7 +2,8 @@
|
||||
"name": "tauri-build",
|
||||
"version": "0.1.2-beta.2",
|
||||
"description": "TypeScript template action",
|
||||
"main": "lib/main.js",
|
||||
"module": "lib/main.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"format": "prettier --write '**/*.ts'",
|
||||
|
@ -13,8 +13,6 @@ interface BuildOptions {
|
||||
}
|
||||
|
||||
export async function buildProject(options: BuildOptions): Promise<string[]> {
|
||||
const projectPath = options.projectPath || process.cwd()
|
||||
|
||||
let args: string[] = options.args || []
|
||||
|
||||
if (options.configPath) {
|
||||
@ -25,7 +23,9 @@ export async function buildProject(options: BuildOptions): Promise<string[]> {
|
||||
args.push('--target', options.target)
|
||||
}
|
||||
|
||||
process.chdir(projectPath)
|
||||
if (options.projectPath) {
|
||||
process.chdir(options.projectPath)
|
||||
}
|
||||
|
||||
if (options.runner) {
|
||||
await execa(options.runner, ['build', ...args], { stdio: 'inherit' })
|
||||
|
@ -1,12 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"exclude": ["node_modules", "**/*.test.ts"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user