occam-open-cli 6.0.145 → 6.0.147

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
@@ -28,7 +28,7 @@ If you would like to contribute or would simply like to have a look at the code,
28
28
  These are the commands and options:
29
29
 
30
30
  ```
31
- open [<command>] [<argument>]
31
+ open [<options>] [<command>] [<argument>]
32
32
 
33
33
  Commands:
34
34
 
@@ -76,6 +76,8 @@ function createConfigurationFile() {
76
76
  }
77
77
 
78
78
  function migrateConfigurationFile() {
79
+ assertConfigurationFileExists();
80
+
79
81
  let json = readRCFile();
80
82
 
81
83
  const migrationMap = {
@@ -103,7 +105,7 @@ function assertConfigurationFileExists() {
103
105
  if (!configurationFileExists) {
104
106
  console.log(CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE);
105
107
 
106
- process.exit();
108
+ process.exit(1);
107
109
  }
108
110
  }
109
111
 
package/bin/configure.js CHANGED
@@ -5,7 +5,7 @@ const { pathUtilities } = require("necessary");
5
5
  const { DOUBLE_DOTS } = require("./constants"),
6
6
  { DEFAULT_HELP, DEFAULT_VERSION } = require("./defaults"),
7
7
  { HELP_COMMAND, VERSION_COMMAND, PUBLISH_COMMAND } = require("./commands"),
8
- { migrateConfigurationFile, checkConfigurationFileExists, assertConfigurationFileExists } = require("./configuration");
8
+ { migrateConfigurationFile, checkConfigurationFileExists } = require("./configuration");
9
9
 
10
10
  const { bottommostNameFromPath } = pathUtilities;
11
11
 
@@ -14,7 +14,15 @@ function configure(command, argument, options, main) {
14
14
 
15
15
  const { help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
16
16
 
17
- if ((help === true) || (version === true) || (command === HELP_COMMAND) || (command === VERSION_COMMAND)) {
17
+ if (false) {
18
+ ///
19
+ } else if (help) {
20
+ command = HELP_COMMAND;
21
+ } else if (version) {
22
+ command = VERSION_COMMAND;
23
+ }
24
+
25
+ if ((command === HELP_COMMAND) || (command === VERSION_COMMAND)) {
18
26
  main(command, argument, options);
19
27
 
20
28
  return;
@@ -22,7 +30,7 @@ function configure(command, argument, options, main) {
22
30
 
23
31
  configurationFileExists = checkConfigurationFileExists();
24
32
 
25
- if (command === null) {
33
+ if (command === PUBLISH_COMMAND) {
26
34
  if (!configurationFileExists) {
27
35
  const currentWorkingDirectoryPath = process.cwd(); ///
28
36
 
@@ -35,15 +43,11 @@ function configure(command, argument, options, main) {
35
43
  if (configurationFileExists) {
36
44
  const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
37
45
 
38
- command = PUBLISH_COMMAND; ///
39
-
40
46
  argument = bottommostOldCurrentWorkingDirectoryName; ///
41
47
  }
42
48
  }
43
49
  }
44
50
 
45
- assertConfigurationFileExists();
46
-
47
51
  migrateConfigurationFile();
48
52
 
49
53
  main(command, argument, options);
package/bin/main.js CHANGED
@@ -14,7 +14,8 @@ const helpAction = require("./action/help"),
14
14
  resetPasswordAction = require("./action/resetPassword"),
15
15
  setShellCommandsAction = require("./action/setShellCommands");
16
16
 
17
- const { DEFAULT_NO, DEFAULT_YES, DEFAULT_HELP, DEFAULT_TAIL, DEFAULT_FOLLOW, DEFAULT_DRY_RUN, DEFAULT_VERSION, DEFAULT_QUIETLY, DEFAULT_LOG_LEVEL } = require("./defaults"),
17
+ const { NO_COMMAND_GIVEN_MESSAGE } = require("./messages"),
18
+ { DEFAULT_NO, DEFAULT_YES, DEFAULT_TAIL, DEFAULT_FOLLOW, DEFAULT_DRY_RUN, DEFAULT_QUIETLY, DEFAULT_LOG_LEVEL } = require("./defaults"),
18
19
  { HELP_COMMAND,
19
20
  OPEN_COMMAND,
20
21
  CLONE_COMMAND,
@@ -30,28 +31,23 @@ const { DEFAULT_NO, DEFAULT_YES, DEFAULT_HELP, DEFAULT_TAIL, DEFAULT_FOLLOW, DEF
30
31
  SET_SHELL_COMMANDS_COMMAND } = require("./commands");
31
32
 
32
33
  function main(command, argument, options) {
33
- const commandMissing = (command === null),
34
- { no = DEFAULT_NO,
34
+ const { no = DEFAULT_NO,
35
35
  yes = DEFAULT_YES,
36
- help = DEFAULT_HELP,
37
36
  tail = DEFAULT_TAIL,
38
37
  follow = DEFAULT_FOLLOW,
39
38
  dryRun = DEFAULT_DRY_RUN,
40
- version = DEFAULT_VERSION,
41
39
  quietly = DEFAULT_QUIETLY,
42
40
  logLevel = DEFAULT_LOG_LEVEL } = options;
43
41
 
44
- if (false) {
45
- ///
46
- } else if (help) {
47
- command = HELP_COMMAND;
48
- } else if (version) {
49
- command = VERSION_COMMAND;
50
- } else if (commandMissing) {
51
- command = HELP_COMMAND;
52
- }
53
-
54
42
  switch (command) {
43
+ case null: {
44
+ console.log(NO_COMMAND_GIVEN_MESSAGE);
45
+
46
+ process.exit(1);
47
+
48
+ break;
49
+ }
50
+
55
51
  case HELP_COMMAND: {
56
52
  helpAction();
57
53
 
package/bin/messages.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
- const PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.",
3
+ const NO_COMMAND_GIVEN_MESSAGE = "No command has been given.",
4
+ PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.",
4
5
  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
6
  CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE = "The action cannot be performed because the configuration file is missing. Run 'open initialise' to create one.",
6
7
  SIGN_OUT_MESSAGE = "You have been signed out.",
@@ -28,6 +29,7 @@ const PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.",
28
29
  SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE = "The shell commands have been set successfully.";
29
30
 
30
31
  module.exports = {
32
+ NO_COMMAND_GIVEN_MESSAGE,
31
33
  PASSWORDS_DO_NOT_MATCH_MESSAGE,
32
34
  SERVER_FAILED_TO_RESPOND_ERROR_MESSAGE,
33
35
  CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-open-cli",
3
3
  "author": "James Smith",
4
- "version": "6.0.145",
4
+ "version": "6.0.147",
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.",