occam-open-cli 5.0.179 → 5.0.180

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.
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
 
3
- const { YES_OPTION, HELP_OPTION, DRY_RUN_OPTION, VERSION_OPTION, QUIETLY_OPTION, LOG_LEVEL_OPTION } = require("./options");
3
+ const { NO_OPTION, YES_OPTION, HELP_OPTION, DRY_RUN_OPTION, VERSION_OPTION, QUIETLY_OPTION, LOG_LEVEL_OPTION } = require("./options");
4
4
 
5
- const y = YES_OPTION,
5
+ const n = NO_OPTION,
6
+ y = YES_OPTION,
6
7
  h = HELP_OPTION,
7
8
  d = DRY_RUN_OPTION,
8
9
  v = VERSION_OPTION,
@@ -10,6 +11,7 @@ const y = YES_OPTION,
10
11
  l = LOG_LEVEL_OPTION
11
12
 
12
13
  module.exports = {
14
+ n,
13
15
  y,
14
16
  h,
15
17
  d,
@@ -8,7 +8,7 @@ const cloneOperation = require("../operation/clone"),
8
8
  const { executeOperations } = require("../utilities/operation"),
9
9
  { SUCCESSFUL_CLONE_MESSAGE, FAILED_CLONE_MESSAGE } = require("../messages");
10
10
 
11
- function cloneAction(argument, quietly, yes) {
11
+ function cloneAction(argument, quietly, yes, no) {
12
12
  const releaseName = argument, ///
13
13
  operations = [
14
14
  releaseNamePromptOperation,
@@ -17,6 +17,7 @@ function cloneAction(argument, quietly, yes) {
17
17
  cloneReleasesOperation
18
18
  ],
19
19
  context = {
20
+ no,
20
21
  yes,
21
22
  quietly,
22
23
  releaseName
@@ -7,7 +7,7 @@ const openOperation = require("../operation/open"),
7
7
  const { executeOperations } = require("../utilities/operation"),
8
8
  { SUCCESSFUL_OPEN_MESSAGE, FAILED_OPEN_MESSAGE } = require("../messages");
9
9
 
10
- function openAction(argument, quietly, yes) {
10
+ function openAction(argument, quietly, yes, no) {
11
11
  const releaseName = argument, ///
12
12
  operations = [
13
13
  releaseNamePromptOperation,
@@ -15,6 +15,7 @@ function openAction(argument, quietly, yes) {
15
15
  openReleasesOperation
16
16
  ],
17
17
  context = {
18
+ no,
18
19
  yes,
19
20
  quietly,
20
21
  releaseName
package/bin/actions.js CHANGED
@@ -13,7 +13,7 @@ const helpAction = require("./action/help"),
13
13
  createAccountAction = require("./action/createAccount"),
14
14
  resetPasswordAction = require("./action/resetPassword");
15
15
 
16
- const { DEFAULT_YES, DEFAULT_HELP, DEFAULT_DRY_RUN, DEFAULT_VERSION, DEFAULT_QUIETLY, DEFAULT_LOG_LEVEL } = require("./defaults"),
16
+ const { DEFAULT_NO, DEFAULT_YES, DEFAULT_HELP, DEFAULT_DRY_RUN, DEFAULT_VERSION, DEFAULT_QUIETLY, DEFAULT_LOG_LEVEL } = require("./defaults"),
17
17
  { HELP_COMMAND,
18
18
  OPEN_COMMAND,
19
19
  CLONE_COMMAND,
@@ -29,7 +29,8 @@ const { DEFAULT_YES, DEFAULT_HELP, DEFAULT_DRY_RUN, DEFAULT_VERSION, DEFAULT_QUI
29
29
 
30
30
  function actions(command, argument, options) {
31
31
  const commandMissing = (command === null),
32
- { yes = DEFAULT_YES,
32
+ { no = DEFAULT_NO,
33
+ yes = DEFAULT_YES,
33
34
  help = DEFAULT_HELP,
34
35
  dryRun = DEFAULT_DRY_RUN,
35
36
  version = DEFAULT_VERSION,
@@ -48,8 +49,8 @@ function actions(command, argument, options) {
48
49
 
49
50
  switch (command) {
50
51
  case HELP_COMMAND : helpAction(); break;
51
- case OPEN_COMMAND : openAction(argument, quietly, yes); break;
52
- case CLONE_COMMAND : cloneAction(argument, quietly, yes); break;
52
+ case OPEN_COMMAND : openAction(argument, quietly, yes, no); break;
53
+ case CLONE_COMMAND : cloneAction(argument, quietly, yes, no); break;
53
54
  case VERSION_COMMAND : versionAction(); break;
54
55
  case PUBLISH_COMMAND : publishAction(argument, dryRun, logLevel); break;
55
56
  case SIGN_IN_COMMAND : signInAction(argument); break;
package/bin/constants.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
- const YES = "yes",
3
+ const NO = "no",
4
+ YES = "yes",
4
5
  END = "end",
5
6
  DATA = "data",
6
7
  OPEN = "open",
@@ -13,6 +14,7 @@ const YES = "yes",
13
14
  PACKAGE_JSON = "package.json";
14
15
 
15
16
  module.exports = {
17
+ NO,
16
18
  YES,
17
19
  END,
18
20
  DATA,
package/bin/defaults.js CHANGED
@@ -4,7 +4,8 @@ const { levels } = require("necessary");
4
4
 
5
5
  const { INFO_LEVEL } = levels;
6
6
 
7
- const DEFAULT_YES = false,
7
+ const DEFAULT_NO = false,
8
+ DEFAULT_YES = false,
8
9
  DEFAULT_HELP = false,
9
10
  DEFAULT_HOST = "https://openmathematics.org",
10
11
  DEFAULT_DRY_RUN = false,
@@ -14,6 +15,7 @@ const DEFAULT_YES = false,
14
15
  DEFAULT_GITHUB_HOST_NAME = "github.com";
15
16
 
16
17
  module.exports = {
18
+ DEFAULT_NO,
17
19
  DEFAULT_YES,
18
20
  DEFAULT_HELP,
19
21
  DEFAULT_HOST,
@@ -2,7 +2,7 @@
2
2
 
3
3
  const { shellUtilities, fileSystemUtilities, asynchronousUtilities } = require("necessary");
4
4
 
5
- const { YES } = require("../constants"),
5
+ const { YES, NO} = require("../constants"),
6
6
  { validateAnswer } = require("../utilities/validate"),
7
7
  { isAnswerAffirmative } = require("../utilities/prompt"),
8
8
  { INVALID_ANSWER_MESSAGE } = require("../messages");
@@ -46,11 +46,19 @@ function openReleasePromptOperation(release, next, done, context) {
46
46
  return;
47
47
  }
48
48
 
49
- const { yes } = context,
50
- answer = yes ?
51
- YES :
52
- null,
53
- description = `Overwrite the existing '${name}' package? (y)es (n)o: `,
49
+ let answer = null;
50
+
51
+ const { yes, no } = context;
52
+
53
+ if (yes) {
54
+ answer = YES;
55
+ }
56
+
57
+ if (no) {
58
+ answer = NO;
59
+ }
60
+
61
+ const description = `Overwrite the existing '${name}' package? (y)es (n)o: `,
54
62
  errorMessage = INVALID_ANSWER_MESSAGE,
55
63
  validationFunction = validateAnswer, ///
56
64
  options = {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const { shellUtilities } = require("necessary");
4
4
 
5
- const { YES } = require("../../constants"),
5
+ const { YES, NO } = require("../../constants"),
6
6
  { isAnswerAffirmative } = require("../../utilities/prompt"),
7
7
  { validateAffirmation } = require("../../utilities/validate"),
8
8
  { INVALID_AFFIRMATION_MESSAGE } = require("../../messages"),
@@ -11,11 +11,19 @@ const { YES } = require("../../constants"),
11
11
  const { prompt } = shellUtilities;
12
12
 
13
13
  function cloneDependenciesPromptOperation(proceed, abort, context) {
14
- const { yes } = context,
15
- answer = yes ?
16
- YES :
17
- null,
18
- description = CLONE_DEPENDENCIES_DESCRIPTION,
14
+ let answer = null;
15
+
16
+ const { yes, no } = context;
17
+
18
+ if (yes) {
19
+ answer = YES;
20
+ }
21
+
22
+ if (no) {
23
+ answer = NO;
24
+ }
25
+
26
+ const description = CLONE_DEPENDENCIES_DESCRIPTION,
19
27
  errorMessage = INVALID_AFFIRMATION_MESSAGE,
20
28
  validationFunction = validateAffirmation, ///
21
29
  options = {
package/bin/options.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
- const YES_OPTION = "yes",
3
+ const NO_OPTION = "no",
4
+ YES_OPTION = "yes",
4
5
  HELP_OPTION = "help",
5
6
  VERSION_OPTION = "version",
6
7
  QUIETLY_OPTION = "quietly",
@@ -8,6 +9,7 @@ const YES_OPTION = "yes",
8
9
  LOG_LEVEL_OPTION = "log-level";
9
10
 
10
11
  module.exports = {
12
+ NO_OPTION,
11
13
  YES_OPTION,
12
14
  HELP_OPTION,
13
15
  VERSION_OPTION,
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.179",
4
+ "version": "5.0.180",
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.",