@ms-cloudpack/setup-utilities
Advanced tools
Comparing version 0.4.3 to 0.4.4
import os from 'os'; | ||
import { writeFile } from 'fs/promises'; | ||
import { writeFile, mkdir } from 'fs/promises'; | ||
import path from 'path'; | ||
@@ -8,3 +8,2 @@ import { execFileSync } from 'child_process'; | ||
import { getCertificatePaths } from './getCertificatePaths.js'; | ||
import { ensureDir } from 'fs-extra'; | ||
import { getValidDomains } from './getValidDomains.js'; | ||
@@ -20,6 +19,6 @@ /** | ||
console.log(`Generating self-signed cert for "${domains[0]}" in "${certFolderPath}"`); | ||
const opensslFilePath = await getOpensslPath(); | ||
const opensslFilePath = getOpensslPath(); | ||
console.info(`The "openssl" binary was found in "${opensslFilePath}"`); | ||
// Ensure the folder exists. | ||
await ensureDir(certFolderPath); | ||
await mkdir(certFolderPath, { recursive: true }); | ||
const config = generateOpensslConfig(options); | ||
@@ -26,0 +25,0 @@ const opensslConfigPath = path.join(certFolderPath, `${domains[0]}.cnf`); |
@@ -0,3 +1,3 @@ | ||
import fs from 'fs'; | ||
import { readFile } from 'fs/promises'; | ||
import { exists } from 'fs-extra'; | ||
import { getCertificatePaths } from './getCertificatePaths.js'; | ||
@@ -9,3 +9,3 @@ import { defaultPassphrase } from './defaultPassphrase.js'; | ||
// Return undefined if the certs don't exist. | ||
if (!(await exists(certPath)) || !(await exists(keyPath))) { | ||
if (!fs.existsSync(certPath) || !fs.existsSync(keyPath)) { | ||
return undefined; | ||
@@ -12,0 +12,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare function getOpensslPath(): Promise<string>; | ||
export declare function getOpensslPath(): string; | ||
//# sourceMappingURL=getOpensslPath.d.ts.map |
@@ -0,5 +1,5 @@ | ||
import fs from 'fs'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
import { exists } from 'fs-extra'; | ||
export async function getOpensslPath() { | ||
export function getOpensslPath() { | ||
const openSslFilename = os.type() === 'Windows_NT' ? 'openssl.exe' : 'openssl'; | ||
@@ -10,3 +10,3 @@ const defaultOpenSslPath = os.type() === 'Windows_NT' | ||
const defaultOpenSslFilePath = path.join(defaultOpenSslPath, openSslFilename); | ||
if (!(await exists(defaultOpenSslFilePath))) { | ||
if (!fs.existsSync(defaultOpenSslFilePath)) { | ||
throw Error(`\nCould not find openssl in path: "${defaultOpenSslPath}"\n`); | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "@ms-cloudpack/setup-utilities", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "A set of utilities for setting up projects.", | ||
@@ -24,4 +24,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@ms-cloudpack/common-types": "^0.21.1", | ||
"fs-extra": "^11.2.0" | ||
"@ms-cloudpack/common-types": "^0.22.0" | ||
}, | ||
@@ -28,0 +27,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
6
33807
233
+ Added@ms-cloudpack/common-types@0.22.0(transitive)
- Removedfs-extra@^11.2.0
- Removed@ms-cloudpack/common-types@0.21.1(transitive)
- Removedfs-extra@11.2.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removeduniversalify@2.0.1(transitive)