occam-open-cli 5.0.89 → 5.0.90

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.
@@ -2,11 +2,13 @@
2
2
 
3
3
  const publishOperation = require("../operation/publish"),
4
4
  loadReleaseOperation = require("../operation/loadRelease"),
5
+ updateVersionOperation = require("../operation/updateVersion"),
5
6
  deflateReleaseOperation = require("../operation/deflateRelease"),
6
7
  getIdentityTokenOperation = require("../operation/getIdentityToken"),
7
8
  releaseNamePromptOperation = require("../operation/prompt/releaseName");
8
9
 
9
- const { DEFAULT_LOG_LEVEL } = require("../defaults"),
10
+ const { DOUBLE_DASH } = require("../constants"),
11
+ { DEFAULT_LOG_LEVEL } = require("../defaults"),
10
12
  { executeOperations } = require("../utilities/operation"),
11
13
  { FAILED_PUBLISH_MESSAGE, SUCCESSFUL_PUBLISH_MESSAGE } = require("../messages");
12
14
 
@@ -18,7 +20,8 @@ function publish(argument, options) {
18
20
  releaseNamePromptOperation,
19
21
  loadReleaseOperation,
20
22
  deflateReleaseOperation,
21
- publishOperation
23
+ publishOperation,
24
+ updateVersionOperation
22
25
  ],
23
26
  context = {
24
27
  logLevel,
@@ -26,12 +29,29 @@ function publish(argument, options) {
26
29
  };
27
30
 
28
31
  executeOperations(operations, (completed) => {
29
- const success = completed, ///
32
+ const { success, version, messages } = context,
30
33
  message = success ?
31
- SUCCESSFUL_PUBLISH_MESSAGE :
32
- FAILED_PUBLISH_MESSAGE;
34
+ SUCCESSFUL_PUBLISH_MESSAGE :
35
+ FAILED_PUBLISH_MESSAGE,
36
+ messagesLength = messages.length;
33
37
 
34
- console.log(message);
38
+ if (messagesLength > 0) {
39
+ const message = DOUBLE_DASH; ///
40
+
41
+ messages.push(message);
42
+ }
43
+
44
+ if (version !== null) {
45
+ const message = `Version ${version}.`;
46
+
47
+ messages.push(message);
48
+ }
49
+
50
+ messages.push(message);
51
+
52
+ messages.forEach((message) => {
53
+ console.log(message);
54
+ });
35
55
 
36
56
  process.exit();
37
57
  }, context);
package/bin/constants.js CHANGED
@@ -7,6 +7,7 @@ const END = "end",
7
7
  HOST_URL = "hostURL",
8
8
  OPEN_CLI = "Open-CLI",
9
9
  DOUBLE_DOTS = "..",
10
+ DOUBLE_DASH = "--",
10
11
  EMPTY_STRING = "",
11
12
  PACKAGE_JSON = "package.json";
12
13
 
@@ -18,6 +19,7 @@ module.exports = {
18
19
  HOST_URL,
19
20
  OPEN_CLI,
20
21
  DOUBLE_DOTS,
22
+ DOUBLE_DASH,
21
23
  EMPTY_STRING,
22
24
  PACKAGE_JSON
23
25
  };
@@ -4,7 +4,7 @@ const post = require("../post");
4
4
 
5
5
  const { PUBLISH_API_URI } = require("../uris");
6
6
 
7
- function deprecateOperation(proceed, abort, context) {
7
+ function publishOperation(proceed, abort, context) {
8
8
  const { logLevel, releaseName, identityToken, deflatedRelease } = context,
9
9
  uri = `${PUBLISH_API_URI}/${releaseName}`,
10
10
  json = {
@@ -14,12 +14,16 @@ function deprecateOperation(proceed, abort, context) {
14
14
  };
15
15
 
16
16
  post(uri, json, (json) => {
17
- const { success } = json;
17
+ const { success, version, messages } = json;
18
18
 
19
- success ?
20
- proceed() :
21
- abort();
19
+ Object.assign(context, {
20
+ success,
21
+ version,
22
+ messages
23
+ });
24
+
25
+ proceed();
22
26
  });
23
27
  }
24
28
 
25
- module.exports = deprecateOperation;
29
+ module.exports = publishOperation;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ const { fileSystemUtilities } = require("necessary");
4
+
5
+ const { fileNames } = require("occam-file-system");
6
+
7
+ const { META_JSON_FILE_NAME } = fileNames,
8
+
9
+ function updateVersionOperation(proceed, abort, context) {
10
+ const { success } = context;
11
+
12
+ if (success) {
13
+ const { version } = context;
14
+
15
+
16
+ }
17
+
18
+ proceed();
19
+ }
20
+
21
+ module.exports = updateVersionOperation;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-open-cli",
3
3
  "author": "James Smith",
4
- "version": "5.0.89",
4
+ "version": "5.0.90",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-open-cli",
7
7
  "description": "Occam's command line package management tool.",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.15",
14
14
  "necessary": "^11.1.4",
15
- "occam-file-system": "^5.0.59"
15
+ "occam-file-system": "^5.0.60"
16
16
  },
17
17
  "scripts": {},
18
18
  "bin": {