only change dir optionally

This commit is contained in:
Jonas Kruckenberg 2022-05-08 15:55:56 +02:00
parent 867e9d7bed
commit 5fa2b7e361
No known key found for this signature in database
GPG Key ID: 21AD3B3C266BDE3D
4 changed files with 13 additions and 6 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-build": patch
---
Only change working directory when projectPath is given.

View File

@ -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'",

View File

@ -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' })

View File

@ -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"]
}