1- import { commands , workspace , ExtensionContext } from 'vscode' ;
1+ import { commands , workspace , ExtensionContext , window } from 'vscode' ;
22import * as fs from 'fs' ;
33import * as path from 'path' ;
44import * as mkdirp from 'mkdirp' ;
@@ -15,27 +15,42 @@ export function activate(context: ExtensionContext) {
1515 const templatePath = path . join ( githubPath , 'ISSUE_TEMPLATE' ) ;
1616 mkdirp ( templatePath , ( err ) => {
1717 if ( err )
18- throw err ;
18+ {
19+ window . showErrorMessage ( err . message ) ;
20+ throw err ;
21+ }
1922 else
2023 {
2124 fs . writeFile ( templatePath + '/bug_report.md' , data . bugData , ( err ) => {
22- if ( err ) throw err ;
23- console . log ( err ) ;
25+ if ( err )
26+ {
27+ window . showErrorMessage ( err . message ) ;
28+ throw err ;
29+ }
2430 console . log ( 'The file has been saved!' ) ;
2531 } ) ;
2632 fs . writeFile ( templatePath + '/feature_request.md' , data . featureData , ( err ) => {
27- if ( err ) throw err ;
28- console . log ( err ) ;
33+ if ( err )
34+ {
35+ window . showErrorMessage ( err . message ) ;
36+ throw err ;
37+ }
2938 console . log ( 'The file has been saved!' ) ;
3039 } ) ;
3140 fs . writeFile ( githubPath + '/CODEOWNERS' , data . codeOwners , ( err ) => {
32- if ( err ) throw err ;
33- console . log ( err ) ;
41+ if ( err )
42+ {
43+ window . showErrorMessage ( err . message ) ;
44+ throw err ;
45+ }
3446 console . log ( 'The file has been saved!' ) ;
3547 } ) ;
3648 fs . writeFile ( githubPath + '/CODE_OF_CONDUCT.md' , data . codeOFConduct , ( err ) => {
37- if ( err ) throw err ;
38- console . log ( err ) ;
49+ if ( err )
50+ {
51+ window . showErrorMessage ( err . message ) ;
52+ throw err ;
53+ }
3954 console . log ( 'The file has been saved!' ) ;
4055 } ) ;
4156 }
0 commit comments