occam-open-cli 5.0.160 → 5.0.162
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/publish.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const publishOperation = require("../operation/publish"),
|
|
4
4
|
loadProjectOperation = require("../operation/loadProject"),
|
|
5
5
|
packReleaseOperation = require("../operation/packRelease"),
|
|
6
|
+
validateProjectOperation = require("../operation/validateProject"),
|
|
6
7
|
getIdentityTokenOperation = require("../operation/getIdentityToken"),
|
|
7
8
|
releaseNamePromptOperation = require("../operation/prompt/releaseName"),
|
|
8
9
|
updateMetaJSONFileVersionOperation = require("../operation/updateMetaJSONFileVersion");
|
|
@@ -17,6 +18,7 @@ function publishAction(argument, dryRun, logLevel) {
|
|
|
17
18
|
getIdentityTokenOperation,
|
|
18
19
|
releaseNamePromptOperation,
|
|
19
20
|
loadProjectOperation,
|
|
21
|
+
validateProjectOperation,
|
|
20
22
|
packReleaseOperation,
|
|
21
23
|
publishOperation,
|
|
22
24
|
updateMetaJSONFileVersionOperation
|
package/bin/messages.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const MISSING_README_FILE_MESSAGE = "The readme file is missing.",
|
|
4
|
+
MISSING_META_JSON_FILE_MESSAGE = "The 'meta.json' file is missing.",
|
|
5
|
+
PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.",
|
|
4
6
|
SERVER_FAILED_TO_RESPOND_ERROR_MESSAGE = "The server did not respond in a timely or intelligible fashion. If this problem persists then please be kind enough to report it.",
|
|
5
7
|
CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE = "The action cannot be performed because the configuration file is missing. Run 'open initialise' to create one.",
|
|
6
8
|
SIGN_OUT_MESSAGE = "You have been signed out.",
|
|
@@ -26,6 +28,8 @@ const PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.",
|
|
|
26
28
|
SUCCESSFUL_SET_OPTIONS_MESSAGE = "The options have been set successfully.";
|
|
27
29
|
|
|
28
30
|
module.exports = {
|
|
31
|
+
MISSING_README_FILE_MESSAGE,
|
|
32
|
+
MISSING_META_JSON_FILE_MESSAGE,
|
|
29
33
|
PASSWORDS_DO_NOT_MATCH_MESSAGE,
|
|
30
34
|
SERVER_FAILED_TO_RESPOND_ERROR_MESSAGE,
|
|
31
35
|
CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { MISSING_README_FILE_MESSAGE, MISSING_META_JSON_FILE_MESSAGE } = require("../messages");
|
|
4
|
+
|
|
5
|
+
function validateProjectOperation(proceed, abort, context) {
|
|
6
|
+
const { project } = context,
|
|
7
|
+
readMeFile = project.getReadmeFile(),
|
|
8
|
+
metaJSONFile = project.getMetaJSONFile();
|
|
9
|
+
|
|
10
|
+
const messages = [];
|
|
11
|
+
|
|
12
|
+
if (readMeFile === null) {
|
|
13
|
+
const message = MISSING_README_FILE_MESSAGE;
|
|
14
|
+
|
|
15
|
+
messages.push(message);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (metaJSONFile === null) {
|
|
19
|
+
const message = MISSING_META_JSON_FILE_MESSAGE;
|
|
20
|
+
|
|
21
|
+
messages.push(message);
|
|
22
|
+
} else {
|
|
23
|
+
const version = project.getVersion();
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const messagesLength = messages.length;
|
|
29
|
+
|
|
30
|
+
if (messagesLength > 0) {
|
|
31
|
+
const success = false;
|
|
32
|
+
|
|
33
|
+
Object.assign(context, {
|
|
34
|
+
success,
|
|
35
|
+
messages
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
abort();
|
|
39
|
+
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
debugger
|
|
44
|
+
|
|
45
|
+
proceed();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = validateProjectOperation;
|
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.
|
|
4
|
+
"version": "5.0.162",
|
|
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.21",
|
|
14
14
|
"necessary": "^11.2.0",
|
|
15
|
-
"occam-file-system": "^5.0.
|
|
15
|
+
"occam-file-system": "^5.0.123"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {},
|
|
18
18
|
"bin": {
|