occam-open-cli 5.0.79 → 5.0.81

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/README.md CHANGED
@@ -59,9 +59,11 @@ Commands:
59
59
 
60
60
  Options:
61
61
 
62
+ --help|-h Show this help
63
+
62
64
  --version|-v Show the version
63
65
 
64
- --help|-h Show this help
66
+ --log-level|-l Set the log level when publishing
65
67
  ```
66
68
 
67
69
  This is slightly different from `npm` in that `open` is usually executed from the parent directory of a project rather than from within the project sub-directory itself. Projects might reside in a `~/Mathematics/` directory, for example, in which case you should initialise `open` in there:
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
- const { HELP_OPTION, VERSION_OPTION } = require("./options");
3
+ const { HELP_OPTION, VERSION_OPTION, LOG_LEVEL_OPTION } = require("./options");
4
4
 
5
5
  const h = HELP_OPTION,
6
- v = VERSION_OPTION;
6
+ v = VERSION_OPTION,
7
+ l = LOG_LEVEL_OPTION
7
8
 
8
9
  module.exports = {
9
10
  h,
10
- v
11
+ v,
12
+ l
11
13
  };
@@ -31,9 +31,11 @@ Commands:
31
31
 
32
32
  Options:
33
33
 
34
+ --help|-h Show this help
35
+
34
36
  --version|-v Show the version
35
37
 
36
- --help|-h Show this help
38
+ --log-level|-l Set the log level when publishing
37
39
 
38
40
  Further information:
39
41
 
@@ -6,11 +6,13 @@ const publishOperation = require("../operation/publish"),
6
6
  getIdentityTokenOperation = require("../operation/getIdentityToken"),
7
7
  releaseNamePromptOperation = require("../operation/prompt/releaseName");
8
8
 
9
- const { executeOperations } = require("../utilities/operation"),
9
+ const { DEFAULT_LOG_LEVEL } = require("../defaults"),
10
+ { executeOperations } = require("../utilities/operation"),
10
11
  { FAILED_PUBLISH_MESSAGE, SUCCESSFUL_PUBLISH_MESSAGE } = require("../messages");
11
12
 
12
- function publish(argument) {
13
- const releaseName = argument, ///
13
+ function publish(argument, options) {
14
+ const { logLevel = DEFAULT_LOG_LEVEL } = options,
15
+ releaseName = argument, ///
14
16
  operations = [
15
17
  getIdentityTokenOperation,
16
18
  releaseNamePromptOperation,
@@ -19,6 +21,7 @@ function publish(argument) {
19
21
  publishOperation
20
22
  ],
21
23
  context = {
24
+ logLevel,
22
25
  releaseName
23
26
  };
24
27
 
package/bin/actions.js CHANGED
@@ -45,7 +45,7 @@ function actions(command, argument, options) {
45
45
  case CLONE_COMMAND : clone(argument); break;
46
46
  case VERSION_COMMAND : version(); break;
47
47
  case INSTALL_COMMAND : open(argument); break;
48
- case PUBLISH_COMMAND : publish(argument); break;
48
+ case PUBLISH_COMMAND : publish(argument, options); break;
49
49
  case SIGN_IN_COMMAND : signIn(argument); break;
50
50
  case SIGN_OUT_COMMAND : signOut(); break;
51
51
  case DEPRECATE_COMMAND : deprecate(argument); break;
package/bin/defaults.js CHANGED
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ const { levels } = require("necessary");
4
+
5
+ const { INFO_LEVEL } = levels;
6
+
3
7
  const DEFAULT_HOST = "https://openmathematics.org",
4
- DEFAULT_USE_SSH = false,
5
- DEFAULT_HOST_NAME_SUFFIX = "",
8
+ DEFAULT_LOG_LEVEL = INFO_LEVEL,
6
9
  DEFAULT_GITHUB_HOST_NAME = "github.com";
7
10
 
8
11
  module.exports = {
9
12
  DEFAULT_HOST,
10
- DEFAULT_USE_SSH,
11
- DEFAULT_HOST_NAME_SUFFIX,
13
+ DEFAULT_LOG_LEVEL,
12
14
  DEFAULT_GITHUB_HOST_NAME
13
15
  };
@@ -5,9 +5,10 @@ const post = require("../post");
5
5
  const { PUBLISH_API_URI } = require("../uris");
6
6
 
7
7
  function deprecateOperation(proceed, abort, context) {
8
- const { releaseName, identityToken, deflatedRelease } = context,
8
+ const { logLevel, releaseName, identityToken, deflatedRelease } = context,
9
9
  uri = `${PUBLISH_API_URI}/${releaseName}`,
10
10
  json = {
11
+ logLevel,
11
12
  identityToken,
12
13
  deflatedRelease
13
14
  };
package/bin/options.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  const HELP_OPTION = "help",
4
- VERSION_OPTION = "version";
4
+ VERSION_OPTION = "version",
5
+ LOG_LEVEL_OPTION = "log-level";
5
6
 
6
7
  module.exports = {
7
8
  HELP_OPTION,
8
- VERSION_OPTION
9
+ VERSION_OPTION,
10
+ LOG_LEVEL_OPTION
9
11
  };
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.79",
4
+ "version": "5.0.81",
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.45"
15
+ "occam-file-system": "^5.0.47"
16
16
  },
17
17
  "scripts": {},
18
18
  "bin": {