File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/cli/lib/templates Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,8 @@ export class ReactTemplate implements Template {
109109 const components = require ( "@igniteui/cli-core/packages/components" ) ;
110110 const igResPath = path . join ( projectPath , this . igniteResources ) ;
111111
112- if ( fs . existsSync ( igResPath ) ) {
113- const fd = fs . openSync ( igResPath , fs . constants . O_RDWR ) ;
112+ try {
113+ const fd = fs . openSync ( igResPath , fs . constants . O_RDWR | fs . constants . O_CREAT ) ;
114114 let igniteuiResFile = fs . readFileSync ( fd , "utf8" ) ;
115115 const freeVersionPath = "ignite-ui/" ;
116116 const fullVersionPath = "@infragistics/ignite-ui-full/en/" ;
@@ -124,7 +124,6 @@ export class ReactTemplate implements Template {
124124 igniteuiResFile = igniteuiResFile . replace ( freeVersionPath , fullVersionPath ) ;
125125 igniteuiResFile = igniteuiResFile . replace ( "-lite" , "" ) ;
126126 }
127-
128127 fs . ftruncateSync ( fd , 0 ) ;
129128 fs . writeSync ( fd , igniteuiResFile ) ;
130129 }
@@ -134,8 +133,9 @@ export class ReactTemplate implements Template {
134133 }
135134
136135 fs . closeSync ( fd ) ;
137- } else {
138- Util . log ( `igniteuiResources.js file NOT found!` ) ;
136+ } catch ( err ) {
137+ Util . error ( `Error while updating igniteuiResources.js: ${ err . message } ` ) ;
138+ throw err ;
139139 }
140140 }
141141
You can’t perform that action at this time.
0 commit comments