Skip to content

Commit

Permalink
feat(myca): options of runOpenssl() accepts debug property
Browse files Browse the repository at this point in the history
default false
  • Loading branch information
waitingsong committed Jul 21, 2023
1 parent 8ca83fb commit 77dd565
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/myca/src/lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ import { initialConfig, reqSubjectFields } from './config.js'
import { CertDNkeys, Config, IssueOpts } from './types.js'


export async function runOpenssl(args: string[], options?: { cwd?: string, input?: string }): Promise<string> {
export interface RunOpensslOptions {
cwd?: string
input?: string
/**
* @default false
*/
debug?: boolean
}

export async function runOpenssl(args: string[], options?: RunOpensslOptions): Promise<string> {
const vv = $.verbose
const verbose = options?.debug ?? false
$.verbose = !! verbose

let currDir = ''

// await $`export`
Expand All @@ -36,6 +49,7 @@ export async function runOpenssl(args: string[], options?: { cwd?: string, input
}
finally {
currDir && cd(currDir)
$.verbose = vv
}

return stdout
Expand Down

0 comments on commit 77dd565

Please sign in to comment.