occam-open-cli 5.0.108 → 5.0.109
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/bin/action/clone.js +2 -1
- package/bin/actions.js +1 -1
- package/bin/operation/clone.js +21 -2
- package/bin/operation/unpackReleases.js +11 -11
- package/package.json +1 -1
package/bin/action/clone.js
CHANGED
|
@@ -7,7 +7,7 @@ const cloneOperation = require("../operation/clone"),
|
|
|
7
7
|
const { executeOperations } = require("../utilities/operation"),
|
|
8
8
|
{ SUCCESSFUL_CLONE_MESSAGE, FAILED_CLONE_MESSAGE } = require("../messages");
|
|
9
9
|
|
|
10
|
-
function cloneAction(argument) {
|
|
10
|
+
function cloneAction(argument, quietly) {
|
|
11
11
|
const releaseName = argument, ///
|
|
12
12
|
operations = [
|
|
13
13
|
releaseNamePromptOperation,
|
|
@@ -15,6 +15,7 @@ function cloneAction(argument) {
|
|
|
15
15
|
cloneOperation
|
|
16
16
|
],
|
|
17
17
|
context = {
|
|
18
|
+
quietly,
|
|
18
19
|
releaseName
|
|
19
20
|
};
|
|
20
21
|
|
package/bin/actions.js
CHANGED
|
@@ -45,7 +45,7 @@ function actions(command, argument, options) {
|
|
|
45
45
|
|
|
46
46
|
switch (command) {
|
|
47
47
|
case HELP_COMMAND : helpAction(); break;
|
|
48
|
-
case CLONE_COMMAND : cloneAction(argument); break;
|
|
48
|
+
case CLONE_COMMAND : cloneAction(argument, quietly); break;
|
|
49
49
|
case VERSION_COMMAND : versionAction(); break;
|
|
50
50
|
case INSTALL_COMMAND : openAction(argument); break;
|
|
51
51
|
case PUBLISH_COMMAND : publishAction(argument, dryRun, logLevel); break;
|
package/bin/operation/clone.js
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { exec } = require("child_process")
|
|
3
|
+
const { exec } = require("child_process"),
|
|
4
|
+
{ fileSystemUtilities } = require("necessary");
|
|
5
|
+
|
|
6
|
+
const { checkEntryExists } = fileSystemUtilities;
|
|
4
7
|
|
|
5
8
|
const { getOptions } = require("../configuration"),
|
|
6
9
|
{ DEFAULT_GITHUB_HOST_NAME } = require("../defaults");
|
|
7
10
|
|
|
8
11
|
function cloneOperation(proceed, abort, context) {
|
|
12
|
+
const { releaseName } = context,
|
|
13
|
+
path = releaseName, ///
|
|
14
|
+
entryExists = checkEntryExists(path);
|
|
15
|
+
|
|
16
|
+
if (entryExists) {
|
|
17
|
+
const { quietly } = context;
|
|
18
|
+
|
|
19
|
+
if (!quietly) {
|
|
20
|
+
console.log(`Cannot clone the '${releaseName}' package because an entry of that name already exists.`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
proceed();
|
|
24
|
+
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
9
28
|
let { repository } = context;
|
|
10
29
|
|
|
11
30
|
const options = getOptions(),
|
|
@@ -27,7 +46,7 @@ function cloneOperation(proceed, abort, context) {
|
|
|
27
46
|
}
|
|
28
47
|
|
|
29
48
|
proceed();
|
|
30
|
-
})
|
|
49
|
+
});
|
|
31
50
|
}
|
|
32
51
|
|
|
33
52
|
module.exports = cloneOperation;
|
|
@@ -13,27 +13,27 @@ function unpackReleasesOperation(proceed, abort, context) {
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const { quietly } = context;
|
|
17
|
-
|
|
18
16
|
releases.forEach((release) => {
|
|
19
17
|
const { name } = release,
|
|
20
18
|
path = name, ///
|
|
21
19
|
entryExists = checkEntryExists(path);
|
|
22
20
|
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
releaseJSON = release, ///
|
|
26
|
-
releaseJSONString = JSON.stringify(releaseJSON),
|
|
27
|
-
content = releaseJSONString; ///
|
|
21
|
+
if (entryExists) {
|
|
22
|
+
const { quietly } = context;
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
if (!quietly) {
|
|
25
|
+
console.log(`Cannot write the '${name}' package to disk because an entry of that name already exists.`);
|
|
26
|
+
}
|
|
30
27
|
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const filePath = path, ///
|
|
32
|
+
releaseJSON = release, ///
|
|
33
|
+
releaseJSONString = JSON.stringify(releaseJSON),
|
|
34
|
+
content = releaseJSONString; ///
|
|
35
|
+
|
|
36
|
+
writeFile(filePath, content);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
proceed();
|
package/package.json
CHANGED