closer-cli 0.5.3 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helpers.js +6 -7
- package/package.json +1 -1
package/helpers.js
CHANGED
|
@@ -48,25 +48,24 @@ exports.importCsvFromFile = (file, csvType, outputDir, spinner, ws, delimiter =
|
|
|
48
48
|
|
|
49
49
|
let readStream = null
|
|
50
50
|
|
|
51
|
+
if (!fs.existsSync(outputDir)) {
|
|
52
|
+
fs.mkdirSync(outputDir, { recursive: true })
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
const errorCsvFile = path.resolve(outputDir, `${csvType}_errors.csv`)
|
|
52
56
|
const errorFileStream = fs.createWriteStream(errorCsvFile)
|
|
53
57
|
|
|
54
58
|
const skippedCsvFile = path.resolve(outputDir, `${csvType}_skipped.csv`)
|
|
55
59
|
const skippedFileStream = fs.createWriteStream(skippedCsvFile)
|
|
56
60
|
|
|
57
|
-
const filename = path.basename(file)
|
|
58
|
-
const dirname = path.dirname(errorCsvFile)
|
|
59
|
-
if (!fs.existsSync(dirname)) {
|
|
60
|
-
process.umask(0o002)
|
|
61
|
-
fs.mkdirSync(dirname, { recursive: true })
|
|
62
|
-
}
|
|
63
|
-
|
|
64
61
|
let header = ''
|
|
65
62
|
let lineNumber = 0
|
|
66
63
|
let countImported = 0
|
|
67
64
|
let countFailed = 0
|
|
68
65
|
let countSkipped = 0
|
|
69
66
|
|
|
67
|
+
const filename = path.basename(file)
|
|
68
|
+
|
|
70
69
|
spinner.start('Loading...')
|
|
71
70
|
|
|
72
71
|
const importRowSuccess = () => {
|