@ms-cloudpack/setup-utilities
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -1,2 +0,1 @@ | ||
import os from 'os'; | ||
import { writeFile, mkdir } from 'fs/promises'; | ||
@@ -29,3 +28,3 @@ import path from 'path'; | ||
const cmdArgs = ['req', '-x509', '-out', certPath, '-keyout', keyPath, '-days', '824', '-config', opensslConfigPath]; | ||
if (os.type() === 'Linux' || os.type() === 'Darwin') { | ||
if (process.platform === 'linux' || process.platform === 'darwin') { | ||
// If -new is not provided openssl will hang expecting input. | ||
@@ -32,0 +31,0 @@ cmdArgs.push('-new'); |
import fs from 'fs'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
export function getOpensslPath() { | ||
const openSslFilename = os.type() === 'Windows_NT' ? 'openssl.exe' : 'openssl'; | ||
const defaultOpenSslPath = os.type() === 'Windows_NT' | ||
const isWindows = process.platform === 'win32'; | ||
const openSslFilename = isWindows ? 'openssl.exe' : 'openssl'; | ||
const defaultOpenSslPath = isWindows | ||
? path.join(process.env.programfiles ?? '', 'git', 'mingw64', 'bin') | ||
@@ -8,0 +8,0 @@ : path.join('/', 'usr', 'bin'); |
@@ -1,2 +0,1 @@ | ||
import os from 'os'; | ||
import { execFileSync } from 'child_process'; | ||
@@ -13,7 +12,6 @@ import { createCertificate } from './createCertificate.js'; | ||
const domains = getValidDomains(domain); | ||
const osType = os.type(); | ||
const isWindows = osType === 'Windows_NT'; | ||
const isWindows = process.platform === 'win32'; | ||
let certPath; | ||
if (!isWindows && osType !== 'Linux' && osType !== 'Darwin') { | ||
throw Error(`Unsupported OS detected: ${os.type()}`); | ||
if (!isWindows && process.platform !== 'linux' && process.platform !== 'darwin') { | ||
throw Error(`Unsupported OS: ${process.platform}`); | ||
} | ||
@@ -20,0 +18,0 @@ const execOptions = { stdio: 'inherit', cwd: currentPath, windowsHide: true, shell: false }; |
{ | ||
"name": "@ms-cloudpack/setup-utilities", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "A set of utilities for setting up projects.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
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
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
33600
230