Skip to content

Commit bec1f5d

Browse files
fix: pass hosts to createCertificate function (#14)
1 parent 02d3947 commit bec1f5d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

cli.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/usr/bin/env node
2+
23
import { existsSync } from 'fs';
4+
35
import { mkdir, writeFile } from 'fs/promises';
46
import minimist from 'minimist';
57
import pc from 'picocolors';
6-
import { DATA_DIR, resolvePath, readFile, pkgVersion } from './src/utils.js';
8+
79
import { createCertificate } from './src/index.js';
10+
import { DATA_DIR, pkgVersion, resolvePath } from './src/utils.js';
811

912
/**
1013
* Init, read variables and create folders
@@ -93,12 +96,15 @@ if (!writeFiles) {
9396
}
9497

9598
try {
96-
const { cert, key } = await createCertificate({
97-
force,
98-
autoUpgrade,
99-
keyFilePath,
100-
certFilePath,
101-
});
99+
const { cert, key } = await createCertificate(
100+
{
101+
force,
102+
autoUpgrade,
103+
keyFilePath,
104+
certFilePath,
105+
},
106+
hosts
107+
);
102108
await writeFile(keyFilePath, key, { encoding: 'utf-8' });
103109
await writeFile(certFilePath, cert, { encoding: 'utf-8' });
104110
} catch (/** @type {any}*/ writeErr) {

0 commit comments

Comments
 (0)