@contentstack/cli-cm-clone 1.3.0 → 1.4.0

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 CHANGED
@@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-clone
15
15
  $ csdx COMMAND
16
16
  running command...
17
17
  $ csdx (--version)
18
- @contentstack/cli-cm-clone/1.3.0 linux-x64 node-v16.19.1
18
+ @contentstack/cli-cm-clone/1.4.0 linux-x64 node-v16.20.0
19
19
  $ csdx --help [COMMAND]
20
20
  USAGE
21
21
  $ csdx COMMAND
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.0",
2
+ "version": "1.4.0",
3
3
  "commands": {
4
4
  "cm:stacks:clone": {
5
5
  "id": "cm:stacks:clone",
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-clone",
3
3
  "description": "Contentstack stack clone plugin",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-cm-export": "^1.4.0",
9
- "@contentstack/cli-cm-import": "^1.4.0",
10
- "@contentstack/cli-command": "^1.2.0",
11
- "@contentstack/cli-utilities": "^1.2.0",
8
+ "@contentstack/cli-cm-export": "^1.4.1",
9
+ "@contentstack/cli-cm-import": "^1.4.1",
10
+ "@contentstack/cli-command": "^1.2.1",
11
+ "@contentstack/cli-utilities": "^1.2.1",
12
12
  "@contentstack/management": "^1.6.1",
13
13
  "async": "^3.2.4",
14
14
  "chalk": "^4.1.0",
@@ -63,6 +63,10 @@
63
63
  "csdxConfig": {
64
64
  "expiredCommands": {
65
65
  "cm:stack-clone": "csdx cm:stacks:clone"
66
+ },
67
+ "shortCommandName": {
68
+ "cm:stacks:clone": "CLN",
69
+ "cm:stack-clone": "O-CLN"
66
70
  }
67
71
  }
68
72
  }
@@ -1,5 +1,5 @@
1
1
  const { Command } = require('@contentstack/cli-command');
2
- const { configHandler, flags } = require('@contentstack/cli-utilities');
2
+ const { configHandler, flags, isAuthenticated } = require('@contentstack/cli-utilities');
3
3
  const { CloneHandler } = require('../../../lib/util/clone-handler');
4
4
  let config = require('../../../lib/util/dummyConfig.json');
5
5
  const path = require('path');
@@ -11,7 +11,6 @@ class StackCloneCommand extends Command {
11
11
  async run() {
12
12
  try {
13
13
  let self = this;
14
- let _authToken = configHandler.get('authtoken');
15
14
  const { flags: cloneCommandFlags } = await self.parse(StackCloneCommand);
16
15
  const {
17
16
  yes,
@@ -70,7 +69,7 @@ class StackCloneCommand extends Command {
70
69
  await this.removeContentDirIfNotEmptyBeforeClone(pathdir); // NOTE remove if folder not empty before clone
71
70
  this.registerCleanupOnInterrupt(pathdir);
72
71
 
73
- config.auth_token = _authToken;
72
+ config.auth_token = configHandler.get('authtoken');
74
73
  config.host = this.cmaHost;
75
74
  config.cdn = this.cdaHost;
76
75
  config.pathDir = pathdir;
@@ -80,7 +79,7 @@ class StackCloneCommand extends Command {
80
79
 
81
80
  if (sourceManagementTokenAlias && destinationManagementTokenAlias) {
82
81
  if (sourceStackBranch || targetStackBranch) {
83
- if (_authToken) {
82
+ if (isAuthenticated()) {
84
83
  handleClone();
85
84
  } else {
86
85
  console.log('Please login to execute this command, csdx auth:login');
@@ -89,7 +88,7 @@ class StackCloneCommand extends Command {
89
88
  } else {
90
89
  handleClone();
91
90
  }
92
- } else if (_authToken) {
91
+ } else if (isAuthenticated()) {
93
92
  handleClone();
94
93
  } else {
95
94
  console.log('Please login to execute this command, csdx auth:login');