occam-open-cli 5.0.114 → 5.0.115
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/actions.js +3 -3
- package/bin/main.js +14 -10
- package/open.js +2 -4
- package/package.json +1 -1
package/bin/actions.js
CHANGED
|
@@ -15,7 +15,7 @@ const helpAction = require("./action/help"),
|
|
|
15
15
|
|
|
16
16
|
const { 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,
|
|
20
20
|
VERSION_COMMAND,
|
|
21
21
|
PUBLISH_COMMAND,
|
|
@@ -42,12 +42,12 @@ function actions(command, argument, options) {
|
|
|
42
42
|
} else if (version) {
|
|
43
43
|
command = VERSION_COMMAND;
|
|
44
44
|
} else if (commandMissing) {
|
|
45
|
-
command =
|
|
45
|
+
command = HELP_COMMAND;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
switch (command) {
|
|
49
49
|
case HELP_COMMAND : helpAction(); break;
|
|
50
|
-
case
|
|
50
|
+
case OPEN_COMMAND : openAction(argument, quietly); break;
|
|
51
51
|
case CLONE_COMMAND : cloneAction(argument, quietly); break;
|
|
52
52
|
case VERSION_COMMAND : versionAction(); break;
|
|
53
53
|
case PUBLISH_COMMAND : publishAction(argument, dryRun, logLevel); break;
|
package/bin/main.js
CHANGED
|
@@ -6,28 +6,32 @@ const actions = require("./actions");
|
|
|
6
6
|
|
|
7
7
|
const { DOUBLE_DOTS } = require("./constants"),
|
|
8
8
|
{ PUBLISH_COMMAND } = require("./commands"),
|
|
9
|
+
{ DEFAULT_HELP, DEFAULT_VERSION } = require("./defaults"),
|
|
9
10
|
{ checkConfigurationFileExists, migrateConfigurationFile } = require("./configuration");
|
|
10
11
|
|
|
11
12
|
const { bottommostNameFromPath } = pathUtilities;
|
|
12
13
|
|
|
13
14
|
function main(command, argument, options) {
|
|
15
|
+
const commandExists = (command !== null),
|
|
16
|
+
{ help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
|
|
17
|
+
|
|
14
18
|
let configurationFileExists = checkConfigurationFileExists();
|
|
15
19
|
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
if (!help && !version && !commandExists && !configurationFileExists) { ///
|
|
21
|
+
const currentWorkingDirectoryPath = process.cwd(); ///
|
|
22
|
+
|
|
23
|
+
process.chdir(DOUBLE_DOTS);
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
const oldCurrentWorkingDirectoryPath = currentWorkingDirectoryPath; ///
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
configurationFileExists = checkConfigurationFileExists();
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
if (configurationFileExists) {
|
|
30
|
+
const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
|
|
32
|
+
argument = bottommostOldCurrentWorkingDirectoryName; ///
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
}
|
|
34
|
+
command = PUBLISH_COMMAND;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
|
package/open.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const { parseArgv } = require("argumentative");
|
|
3
|
+
const { parseArgv } = require("argumentative"),
|
|
4
|
+
{ arrayUtilities } = require("necessary");
|
|
6
5
|
|
|
7
6
|
const main = require("./bin/main"),
|
|
8
7
|
abbreviations = require("./bin/abbreviations");
|
|
9
8
|
|
|
10
9
|
const { argv } = process,
|
|
11
|
-
{ arrayUtilities } = necessary,
|
|
12
10
|
{ first, second } = arrayUtilities;
|
|
13
11
|
|
|
14
12
|
const { commands, options } = parseArgv(argv, abbreviations),
|
package/package.json
CHANGED