Skip to content

Commit

Permalink
fix: pass hosts to createCertificate function (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
italodeverdade authored Feb 5, 2023
1 parent 02d3947 commit bec1f5d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/usr/bin/env node

import { existsSync } from 'fs';

import { mkdir, writeFile } from 'fs/promises';
import minimist from 'minimist';
import pc from 'picocolors';
import { DATA_DIR, resolvePath, readFile, pkgVersion } from './src/utils.js';

import { createCertificate } from './src/index.js';
import { DATA_DIR, pkgVersion, resolvePath } from './src/utils.js';

/**
* Init, read variables and create folders
Expand Down Expand Up @@ -93,12 +96,15 @@ if (!writeFiles) {
}

try {
const { cert, key } = await createCertificate({
force,
autoUpgrade,
keyFilePath,
certFilePath,
});
const { cert, key } = await createCertificate(
{
force,
autoUpgrade,
keyFilePath,
certFilePath,
},
hosts
);
await writeFile(keyFilePath, key, { encoding: 'utf-8' });
await writeFile(certFilePath, cert, { encoding: 'utf-8' });
} catch (/** @type {any}*/ writeErr) {
Expand Down

0 comments on commit bec1f5d

Please sign in to comment.