@cocreate/cli 1.31.0 → 1.31.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.31.2](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.31.1...v1.31.2) (2023-06-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([51cea96](https://github.com/CoCreate-app/CoCreate-cli/commit/51cea96a50d4c139e8cf568694f6e12981516c40))
7
+
8
+ ## [1.31.1](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.31.0...v1.31.1) (2023-06-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Update file dependency version and add console colors, minor code refactoring to CoCreate Config. ([c836d3a](https://github.com/CoCreate-app/CoCreate-cli/commit/c836d3ae070c41704300f5af646b708a01f8f63b))
14
+
1
15
  # [1.31.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.30.0...v1.31.0) (2023-06-09)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cli",
3
- "version": "1.31.0",
3
+ "version": "1.31.2",
4
4
  "description": "Polyrepo management bash CLI tool. Run all git commands and yarn commands on multiple repositories. Also includes a few custom macros for cloning, installing, etc.",
5
5
  "keywords": [
6
6
  "cli",
@@ -58,8 +58,8 @@
58
58
  "coc": "src/coc.js"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/docs": "^1.8.2",
62
- "@cocreate/file": "^1.0.0",
61
+ "@cocreate/docs": "^1.8.13",
62
+ "@cocreate/file": "^1.2.2",
63
63
  "colors": "latest",
64
64
  "glob": "^7.1.7",
65
65
  "prettier": "^2.3.2"
package/src/coc.js CHANGED
@@ -4,6 +4,7 @@ const fs = require("fs");
4
4
  const execute = require('./execute');
5
5
  const argv = process.argv.slice(2);
6
6
  const addMeta = require('./addMeta');
7
+ const colors = require('colors');
7
8
 
8
9
 
9
10
  if (argv.length < 1) {
@@ -57,7 +58,7 @@ if (config['c'] && fs.existsSync(config['c'])) {
57
58
  }];
58
59
  directory = path.dirname(packageJsonPath);
59
60
  console.warn(`using ${packageJsonPath} configuration`.yellow);
60
- }
61
+ }
61
62
  // else {
62
63
  // console.error(`a configuration file can not be found`.red);
63
64
  // process.exit(1);
@@ -40,9 +40,28 @@ module.exports = async function CoCreateConfig(items, processEnv = true, updateG
40
40
  items = [items];
41
41
  }
42
42
  for (let i = 0; i < items.length; i++) {
43
- const { key, prompt, choices } = items[i];
43
+ let { key, prompt, choices } = items[i];
44
44
  if (!key) {
45
45
  if (!prompt && prompt !== '' || !choices) continue;
46
+ for (let choice of Object.keys(choices)) {
47
+ // if (!Array.isArray(choiceItems)) {
48
+ // choiceItems = [choiceItems];
49
+ // }
50
+ // for (let choice of choiceItems) {
51
+ let choiceKey = choices[choice].key
52
+ if (process.env[choiceKey]) {
53
+ config[choiceKey] = process.env[choiceKey];
54
+ return;
55
+ } else if (localConfig[choiceKey]) {
56
+ config[choiceKey] = localConfig[choiceKey];
57
+ return;
58
+
59
+ } else if (globalConfig[choiceKey]) {
60
+ config[choiceKey] = globalConfig[choiceKey];
61
+ return;
62
+ }
63
+ }
64
+ // }
46
65
  const answer = await promptForInput(prompt || `${key}: `);
47
66
  const choice = choices[answer];
48
67
  if (choice) {
@@ -1,6 +1,3 @@
1
- const crud = require('@cocreate/crud-client')
2
- const mime = require('mime-types')
3
- const fs = require('fs');
4
1
  const file = require('@cocreate/file')
5
2
 
6
3
  module.exports = async function upload(repos, args) {