@contentstack/cli-cm-bulk-publish 1.4.6 → 1.4.8
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/README.md +1 -1
- package/package.json +3 -3
- package/src/consumer/publish.js +2 -1
- package/src/util/logger.js +3 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
|
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ csdx (--version)
|
|
21
|
-
@contentstack/cli-cm-bulk-publish/1.4.
|
|
21
|
+
@contentstack/cli-cm-bulk-publish/1.4.8 darwin-arm64 node-v22.2.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-bulk-publish",
|
|
3
3
|
"description": "Contentstack CLI plugin for bulk publish actions",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.8",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "~1.2.
|
|
9
|
-
"@contentstack/cli-utilities": "~1.
|
|
8
|
+
"@contentstack/cli-command": "~1.2.19",
|
|
9
|
+
"@contentstack/cli-utilities": "~1.7.0",
|
|
10
10
|
"bluebird": "^3.7.2",
|
|
11
11
|
"chalk": "^4.1.2",
|
|
12
12
|
"dotenv": "^16.1.4",
|
package/src/consumer/publish.js
CHANGED
|
@@ -9,6 +9,7 @@ const apiVersionForNRP = '3.2';
|
|
|
9
9
|
const nrpApiVersionWarning = `Provided apiVersion is invalid. ${apiVersionForNRP} is only supported value. Continuing with regular bulk-publish for now.`;
|
|
10
10
|
|
|
11
11
|
const { getLoggerInstance, addLogs, getLogsDirPath } = require('../util/logger');
|
|
12
|
+
const { sanitizePath } = require('@contentstack/cli-utilities');
|
|
12
13
|
const logsDir = getLogsDirPath();
|
|
13
14
|
|
|
14
15
|
let logger;
|
|
@@ -18,7 +19,7 @@ function initializeLogger(fileName) {
|
|
|
18
19
|
fileNme = fileName;
|
|
19
20
|
fileNme = `${Date.now()}.${fileNme}`;
|
|
20
21
|
logger = getLoggerInstance(fileNme);
|
|
21
|
-
return path.join(logsDir, fileNme);
|
|
22
|
+
return path.join(logsDir, sanitizePath(fileNme));
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
/* eslint-disable camelcase */
|
package/src/util/logger.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const { sanitizePath } = require('@contentstack/cli-utilities');
|
|
1
2
|
const path = require('path');
|
|
2
3
|
const winston = require('winston');
|
|
3
4
|
const cwd = process.cwd();
|
|
@@ -6,7 +7,7 @@ const logsDir = path.join(cwd, 'contentstack-cli-logs', 'bulk-publish');
|
|
|
6
7
|
let filename;
|
|
7
8
|
|
|
8
9
|
module.exports.getLoggerInstance = (fileName) => {
|
|
9
|
-
filename = path.join(logsDir, fileName);
|
|
10
|
+
filename = path.join(logsDir, sanitizePath(fileName));
|
|
10
11
|
return winston.createLogger({
|
|
11
12
|
transports: [
|
|
12
13
|
new winston.transports.File({ filename: `${filename}.error`, level: 'error' }),
|
|
@@ -17,7 +18,7 @@ module.exports.getLoggerInstance = (fileName) => {
|
|
|
17
18
|
|
|
18
19
|
/* eslint-disable no-multi-assign */
|
|
19
20
|
const getFileLoggerInstance = (module.exports.getFileLoggerInstance = (fileName) => {
|
|
20
|
-
filename = path.join(logsDir, fileName);
|
|
21
|
+
filename = path.join(logsDir, sanitizePath(fileName));
|
|
21
22
|
return winston.createLogger({
|
|
22
23
|
transports: [new winston.transports.File({ filename })],
|
|
23
24
|
});
|