@cloudcommerce/cli 0.6.5 → 0.6.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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @cloudcommerce/cli@0.6.4 build /home/leo/code/ecomplus/cloud-commerce/packages/cli
2
+ > @cloudcommerce/cli@0.6.6 build /home/leo/code/ecomplus/cloud-commerce/packages/cli
3
3
  > sh ../../scripts/build-lib.sh
4
4
 
package/lib/cli.js CHANGED
@@ -37,18 +37,19 @@ if (projectId) {
37
37
 
38
38
  export default async () => {
39
39
  await fs.copy(path.join(__dirname, '..', 'config'), pwd);
40
- const options = Object.keys(argv).reduce((opts, key) => {
40
+ const options = [];
41
+ Object.keys(argv).forEach((key) => {
41
42
  if (key !== '_' && argv[key] !== false) {
42
- // eslint-disable-next-line no-param-reassign
43
- opts += ` --${key} ${argv[key]}`;
43
+ if (argv[key] !== true || (key !== 'codebase' && key !== 'only')) {
44
+ options.push(`--${key}`, argv[key]);
45
+ }
44
46
  }
45
- return opts;
46
- }, '');
47
+ });
47
48
  const $firebase = (cmd) => {
48
- if (cmd === 'deploy' && !options) {
49
- return $`firebase --project=${projectId} ${cmd}${options} --force`;
49
+ if (cmd === 'deploy' && !options.length) {
50
+ return $`firebase --project=${projectId} ${cmd} --force`;
50
51
  }
51
- return $`firebase --project=${projectId} ${cmd}${options}`;
52
+ return $`firebase --project=${projectId} ${cmd} ${options}`;
52
53
  };
53
54
  if (argv._.includes('serve')) {
54
55
  await build();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.6.5",
4
+ "version": "0.6.7",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -26,7 +26,7 @@
26
26
  "libsodium-wrappers": "^0.7.11",
27
27
  "md5": "^2.3.0",
28
28
  "zx": "^7.1.1",
29
- "@cloudcommerce/api": "0.6.5"
29
+ "@cloudcommerce/api": "0.6.7"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "sh ../../scripts/build-lib.sh"
package/src/cli.ts CHANGED
@@ -51,18 +51,19 @@ if (projectId) {
51
51
  export default async () => {
52
52
  await fs.copy(path.join(__dirname, '..', 'config'), pwd);
53
53
 
54
- const options = Object.keys(argv).reduce((opts, key) => {
54
+ const options: string[] = [];
55
+ Object.keys(argv).forEach((key) => {
55
56
  if (key !== '_' && argv[key] !== false) {
56
- // eslint-disable-next-line no-param-reassign
57
- opts += ` --${key} ${argv[key]}`;
57
+ if (argv[key] !== true || (key !== 'codebase' && key !== 'only')) {
58
+ options.push(`--${key}`, argv[key]);
59
+ }
58
60
  }
59
- return opts;
60
- }, '');
61
+ });
61
62
  const $firebase = (cmd: string) => {
62
- if (cmd === 'deploy' && !options) {
63
- return $`firebase --project=${projectId} ${cmd}${options} --force`;
63
+ if (cmd === 'deploy' && !options.length) {
64
+ return $`firebase --project=${projectId} ${cmd} --force`;
64
65
  }
65
- return $`firebase --project=${projectId} ${cmd}${options}`;
66
+ return $`firebase --project=${projectId} ${cmd} ${options}`;
66
67
  };
67
68
 
68
69
  if (argv._.includes('serve')) {