@cocreate/cli 1.22.0 → 1.23.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/coc.js +7 -5
- package/src/commands/nginx.js +1 -1
- package/src/commands/other/nginxConfigManager.js +0 -2
- package/src/execute.js +8 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [1.23.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.22.0...v1.23.0) (2023-04-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* repos not required, args is an array ([7329430](https://github.com/CoCreate-app/CoCreate-cli/commit/7329430ff526291ae1ca99f647000d5581b80734))
|
|
7
|
+
* repos not required, args updated to an array ([43c8197](https://github.com/CoCreate-app/CoCreate-cli/commit/43c8197d2e5d07a34842ca17b7a1bef625171daf))
|
|
8
|
+
|
|
1
9
|
# [1.22.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.21.0...v1.22.0) (2023-04-23)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
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",
|
package/src/coc.js
CHANGED
|
@@ -57,14 +57,16 @@ if (config['c'] && fs.existsSync(config['c'])) {
|
|
|
57
57
|
}];
|
|
58
58
|
directory = path.dirname(packageJsonPath);
|
|
59
59
|
console.warn(`using ${packageJsonPath} configuration`.yellow);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
}
|
|
61
|
+
// else {
|
|
62
|
+
// console.error(`a configuration file can not be found`.red);
|
|
63
|
+
// process.exit(1);
|
|
64
|
+
// }
|
|
64
65
|
config = { hideMessage: false, ...config };
|
|
65
66
|
|
|
66
67
|
(async () => {
|
|
67
|
-
|
|
68
|
+
if (repos && repos.length)
|
|
69
|
+
repos = await addMeta(repos, [], directory)
|
|
68
70
|
let failed = await execute(command, repos, config);
|
|
69
71
|
if (failed) {
|
|
70
72
|
if (failed.length === 0)
|
package/src/commands/nginx.js
CHANGED
|
@@ -66,8 +66,6 @@ server {
|
|
|
66
66
|
listen 443 ssl http2;
|
|
67
67
|
ssl_certificate /etc/letsencrypt/live/${host}/fullchain.pem;
|
|
68
68
|
ssl_certificate_key /etc/letsencrypt/live/${host}/privkey.pem;
|
|
69
|
-
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
70
|
-
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
71
69
|
|
|
72
70
|
}
|
|
73
71
|
|
package/src/execute.js
CHANGED
|
@@ -6,10 +6,11 @@ const util = require('node:util');
|
|
|
6
6
|
const exec = util.promisify(require('node:child_process').exec);
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
module.exports = async function execute(command, repos, config) {
|
|
9
|
+
module.exports = async function execute(command, repos = [], config) {
|
|
10
10
|
let failed = [];
|
|
11
|
-
let
|
|
12
|
-
let
|
|
11
|
+
let args = command.replaceAll("'", '"').trim().split(' ')
|
|
12
|
+
let type = args[0]
|
|
13
|
+
args.shift()
|
|
13
14
|
|
|
14
15
|
let predefined = path.resolve(__dirname, 'commands', type + '.js');
|
|
15
16
|
|
|
@@ -18,16 +19,13 @@ module.exports = async function execute(command, repos, config) {
|
|
|
18
19
|
|
|
19
20
|
if (repos.length == 1)
|
|
20
21
|
console.log(`running on ${repos[0].name} repo`.blue)
|
|
21
|
-
else
|
|
22
|
+
else if (repos.length)
|
|
22
23
|
console.log('running on all repos'.blue)
|
|
23
24
|
|
|
24
|
-
failed = require(predefined)(
|
|
25
|
+
failed = require(predefined)(repos, args)
|
|
25
26
|
|
|
26
27
|
} else {
|
|
27
|
-
|
|
28
|
-
// let type = command.split(' ')[0]
|
|
29
|
-
// let args = command.replace(type, '').replaceAll("'", '"').trim()
|
|
30
|
-
|
|
28
|
+
|
|
31
29
|
for (let repo of repos) {
|
|
32
30
|
try {
|
|
33
31
|
if (repo.exclude && repo.exclude.includes(type))
|
|
@@ -42,7 +40,7 @@ module.exports = async function execute(command, repos, config) {
|
|
|
42
40
|
if (error)
|
|
43
41
|
exitCode = 1
|
|
44
42
|
} else {
|
|
45
|
-
exitCode = await spawn(type,
|
|
43
|
+
exitCode = await spawn(type, args, {
|
|
46
44
|
cwd: repo.absolutePath,
|
|
47
45
|
shell: true,
|
|
48
46
|
stdio: 'inherit'
|