File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,20 @@ prog.command(`v2 <input>`)
65
65
66
66
input . forEach ( ( src , i ) => {
67
67
const dest = output [ i ] ;
68
- const upgraded = upgrade . upgradeTemplate ( fs . readFileSync ( src , 'utf-8' ) ) ;
69
68
70
- mkdirp ( path . dirname ( dest ) ) ;
71
- fs . writeFileSync ( dest , upgraded ) ;
69
+ try {
70
+ const upgraded = upgrade . upgradeTemplate ( fs . readFileSync ( src , 'utf-8' ) ) ;
71
+
72
+ mkdirp ( path . dirname ( dest ) ) ;
73
+ fs . writeFileSync ( dest , upgraded ) ;
74
+ } catch ( err ) {
75
+ console . error ( `${ clorox . bold . red ( `Error transforming ${ src } :` ) } ` ) ;
76
+ console . error ( `${ clorox . red ( err . message ) } ` ) ;
77
+
78
+ if ( err . frame ) {
79
+ console . error ( err . frame ) ;
80
+ }
81
+ }
72
82
} ) ;
73
83
74
84
console . error ( `${ clorox . cyan ( `Wrote ${ output . length } ${ output . length === 1 ? 'file' : 'files' } ` ) } ` )
You can’t perform that action at this time.
0 commit comments