File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import { promises as fs , existsSync } from "fs" ;
2- import { createIfNot } from "./utils/fileUtils"
2+ import { createIfNot } from "./utils/fileUtils.js "
33import * as path from "node:path"
44async function writeSQL ( statement : string , saveFileAs = "" ) {
55 try {
66 const destinationFile = process . argv [ 2 ] || saveFileAs ;
77 if ( ! destinationFile ) {
88 throw new Error ( "Missing saveFileAs parameter" ) ;
99 }
10- createIfNot ( path . resolve ( `/sql/${ destinationFile } .sql` ) )
10+ createIfNot ( path . resolve ( `. /sql/${ destinationFile } .sql` ) )
1111 await fs . writeFile ( `sql/${ process . argv [ 2 ] } .sql` , statement ) ;
1212 } catch ( err ) {
1313 console . log ( err ) ;
@@ -19,7 +19,7 @@ async function readCSV(csvFileName = "") {
1919 if ( ! fileAndTableName ) {
2020 throw new Error ( "Missing csvFileName parameter" ) ;
2121 }
22- if ( existsSync ( path . resolve ( `./csv/${ fileAndTableName } .csv` ) ) ) {
22+ if ( ! existsSync ( path . resolve ( `./csv/${ fileAndTableName } .csv` ) ) ) {
2323 console . log ( "file not found" )
2424 return
2525 }
You can’t perform that action at this time.
0 commit comments