Skip to content

Commit 59bb64e

Browse files
authored
fix(generator): Fix temp cert generator behavior (microsoft#1145)
In some cases, if the windows directory doesn't already exist, the Powershell command won't actually generate the file correctly. cc: @sasivarnan
1 parent 8d7ac22 commit 59bb64e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

local-cli/generator-windows/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ module.exports = yeoman.Base.extend({
5353
const certGenCommand = [
5454
`$cert = New-SelfSignedCertificate -KeyUsage DigitalSignature -KeyExportPolicy Exportable -Subject "CN=${currentUser}" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}Subject Type:End Entity") -CertStoreLocation "Cert:\\CurrentUser\\My"`,
5555
`$pwd = ConvertTo-SecureString -String password -Force -AsPlainText`,
56+
`New-Item -ErrorAction Ignore -ItemType directory -Path ${path.join('windows', this.name)}`,
5657
`Export-PfxCertificate -Cert "cert:\\CurrentUser\\My\\$($cert.Thumbprint)" -FilePath ${path.join('windows', this.name, this.name)}_TemporaryKey.pfx -Password $pwd`,
5758
`$cert.Thumbprint`
5859
];

0 commit comments

Comments
 (0)