File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed
Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,30 @@ if (!certificateName) {
3535const certFilePath = path . join ( baseFolder , `${ certificateName } .pem` ) ;
3636const keyFilePath = path . join ( baseFolder , `${ certificateName } .key` ) ;
3737
38+ console . log ( `Certificate path: ${ certFilePath } ` ) ;
39+
3840if ( ! fs . existsSync ( certFilePath ) || ! fs . existsSync ( keyFilePath ) ) {
39- if ( 0 !== child_process . spawnSync ( 'dotnet' , [
40- 'dev-certs' ,
41- 'https' ,
42- '--export-path' ,
43- certFilePath ,
44- '--format' ,
45- 'Pem' ,
46- '--no-password' ,
47- ] , { stdio : 'inherit' , } ) . status ) {
41+
42+ // mkdir to fix dotnet dev-certs error 3 https://github.com/dotnet/aspnetcore/issues/58330
43+ if ( ! fs . existsSync ( baseFolder ) ) {
44+ fs . mkdirSync ( baseFolder , { recursive : true } ) ;
45+ }
46+ if (
47+ 0 !==
48+ child_process . spawnSync (
49+ "dotnet" ,
50+ [
51+ "dev-certs" ,
52+ "https" ,
53+ "--export-path" ,
54+ certFilePath ,
55+ "--format" ,
56+ "Pem" ,
57+ "--no-password" ,
58+ ] ,
59+ { stdio : "inherit" }
60+ ) . status
61+ ) {
4862 throw new Error ( "Could not create certificate." ) ;
4963 }
5064}
You can’t perform that action at this time.
0 commit comments