occam-open-cli 6.0.144 → 6.0.145

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.
@@ -3,7 +3,7 @@
3
3
  function helpAction() {
4
4
  console.log(`Usage:
5
5
 
6
- open [<command>] [<argument>]
6
+ open [<options>] [<command>] [<argument>]
7
7
 
8
8
  Commands:
9
9
 
@@ -14,7 +14,7 @@ const { rc } = configurationUtilities,
14
14
  { migrate } = versionUtilities,
15
15
  { setRCBaseExtension, checkRCFileExists, updateRCFile, writeRCFile, readRCFile } = rc;
16
16
 
17
- const rcBaseExtension = OPEN;
17
+ const rcBaseExtension = OPEN; ///
18
18
 
19
19
  setRCBaseExtension(rcBaseExtension);
20
20
 
@@ -97,6 +97,16 @@ function checkConfigurationFileExists() {
97
97
  return configurationFileExists;
98
98
  }
99
99
 
100
+ function assertConfigurationFileExists() {
101
+ const configurationFileExists = checkConfigurationFileExists();
102
+
103
+ if (!configurationFileExists) {
104
+ console.log(CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE);
105
+
106
+ process.exit();
107
+ }
108
+ }
109
+
100
110
  module.exports = {
101
111
  retrieveHost,
102
112
  retrieveOptions,
@@ -108,7 +118,8 @@ module.exports = {
108
118
  removeIdentityToken,
109
119
  createConfigurationFile,
110
120
  migrateConfigurationFile,
111
- checkConfigurationFileExists
121
+ checkConfigurationFileExists,
122
+ assertConfigurationFileExists
112
123
  };
113
124
 
114
125
  function readConfigurationFile() {
@@ -136,13 +147,3 @@ function updateConfigurationFile(addedConfiguration, ...deleteConfigurationNames
136
147
 
137
148
  updateRCFile(addedProperties, ...deletedPropertyNames);
138
149
  }
139
-
140
- function assertConfigurationFileExists() {
141
- const configurationFileExists = checkConfigurationFileExists();
142
-
143
- if (!configurationFileExists) {
144
- console.log(CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE);
145
-
146
- process.exit();
147
- }
148
- }
package/bin/configure.js CHANGED
@@ -3,16 +3,27 @@
3
3
  const { pathUtilities } = require("necessary");
4
4
 
5
5
  const { DOUBLE_DOTS } = require("./constants"),
6
- { PUBLISH_COMMAND } = require("./commands"),
7
- { checkConfigurationFileExists, migrateConfigurationFile } = require("./configuration");
6
+ { DEFAULT_HELP, DEFAULT_VERSION } = require("./defaults"),
7
+ { HELP_COMMAND, VERSION_COMMAND, PUBLISH_COMMAND } = require("./commands"),
8
+ { migrateConfigurationFile, checkConfigurationFileExists, assertConfigurationFileExists } = require("./configuration");
8
9
 
9
10
  const { bottommostNameFromPath } = pathUtilities;
10
11
 
11
12
  function configure(command, argument, options, main) {
12
- let configurationFileExists = checkConfigurationFileExists();
13
+ let configurationFileExists;
13
14
 
14
- if (command === PUBLISH_COMMAND) { ///
15
- if (argument === null) {
15
+ const { help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
16
+
17
+ if ((help === true) || (version === true) || (command === HELP_COMMAND) || (command === VERSION_COMMAND)) {
18
+ main(command, argument, options);
19
+
20
+ return;
21
+ }
22
+
23
+ configurationFileExists = checkConfigurationFileExists();
24
+
25
+ if (command === null) {
26
+ if (!configurationFileExists) {
16
27
  const currentWorkingDirectoryPath = process.cwd(); ///
17
28
 
18
29
  process.chdir(DOUBLE_DOTS);
@@ -24,14 +35,16 @@ function configure(command, argument, options, main) {
24
35
  if (configurationFileExists) {
25
36
  const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
26
37
 
38
+ command = PUBLISH_COMMAND; ///
39
+
27
40
  argument = bottommostOldCurrentWorkingDirectoryName; ///
28
41
  }
29
42
  }
30
43
  }
31
44
 
32
- if (configurationFileExists) {
33
- migrateConfigurationFile();
34
- }
45
+ assertConfigurationFileExists();
46
+
47
+ migrateConfigurationFile();
35
48
 
36
49
  main(command, argument, options);
37
50
  }
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.144",
4
+ "version": "6.0.145",
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.",