Skip to content

Commit bb1f5a2

Browse files
Merge pull request #80 from theCalcaholic/fix/cli-expiration-option-ignored
cli/secrets.ts: Fix --expire argument being ignored
2 parents a329466 + 9236a09 commit bb1f5a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/secrets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ function handleGlobalOptions(options: {insecure: boolean} & any) {
3636
* @param secretFile
3737
* @param options
3838
* @param options.passFile
39-
* @param options.days
39+
* @param options.expire
4040
* @param options.password
4141
* @param options.title
4242
* @param options.insecure
4343
*/
4444
export async function createSecret(ncUrl: string, ncUser: string, secretFile: string | undefined, options: {
4545
passFile: string | undefined,
46-
days: number | undefined,
46+
expire: number | undefined,
4747
protect: string | undefined,
4848
title: string | undefined,
4949
insecure: boolean | undefined
@@ -71,7 +71,7 @@ export async function createSecret(ncUrl: string, ncUser: string, secretFile: st
7171
const encrypted = await cryptolib.encrypt(plaintext, privKey, iv)
7272

7373
const expiryDate = new Date()
74-
expiryDate.setDate((new Date()).getDate() + (options.days ?? 7))
74+
expiryDate.setDate((new Date()).getDate() + (options.expire ?? 7))
7575
const postData = JSON.stringify({
7676
title: options.title ?? 'Generated with secrets-cli',
7777
password: options.protect,

0 commit comments

Comments
 (0)