File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,13 @@ export default class Utilities {
39
39
}
40
40
41
41
public static writeStringToFile ( thisRef : any , filePath : string , string : string ) {
42
- if ( ! fs . existsSync ( filePath ) ) {
43
- Logger . error ( thisRef , `Could not find file: ${ filePath } ` ) // this will output error and exit command
44
- } else {
45
- fs . writeFileSync ( filePath , string )
46
- Logger . success ( thisRef , `Hash written to file: ${ filePath } ` ) // this will output error and exit command
47
- }
42
+ if ( ! fs . existsSync ( filePath ) )
43
+ Logger . info ( thisRef , `Could not find file: ${ filePath } , creating new one` ) // this will output error and exit command
44
+ else
45
+ Logger . info ( thisRef , `File already exists: ${ filePath } , overriding content` ) // this will output error and exit command
46
+
47
+ fs . writeFileSync ( filePath , string )
48
+ Logger . success ( thisRef , `Hash written to file: ${ filePath } ` ) // this will output error and exit command
49
+
48
50
}
49
51
}
You can’t perform that action at this time.
0 commit comments