propagate-cli 1.9.21 → 1.9.22

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.
Files changed (2) hide show
  1. package/bin/main.js +14 -12
  2. package/package.json +1 -1
package/bin/main.js CHANGED
@@ -5,31 +5,33 @@ const { pathUtilities } = require("necessary");
5
5
  const actions = require("./actions");
6
6
 
7
7
  const { TWO_DOTS } = require("./constants"),
8
- { PROPAGATE_COMMAND } = require("./commands"),
8
+ { PROPAGATE_COMMAND } = require("./commands");
9
+ const { 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 (command === null) {
17
- if (!configurationFileExists) {
18
- const currentWorkingDirectoryPath = process.cwd(); ///
20
+ if (!help && !version && !commandExists && !configurationFileExists) { ///
21
+ const currentWorkingDirectoryPath = process.cwd(); ///
19
22
 
20
- process.chdir(TWO_DOTS);
23
+ process.chdir(TWO_DOTS);
21
24
 
22
- const oldCurrentWorkingDirectoryPath = currentWorkingDirectoryPath; ///
25
+ const oldCurrentWorkingDirectoryPath = currentWorkingDirectoryPath; ///
23
26
 
24
- configurationFileExists = checkConfigurationFileExists();
27
+ configurationFileExists = checkConfigurationFileExists();
25
28
 
26
- if (configurationFileExists) {
27
- const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
29
+ if (configurationFileExists) {
30
+ const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
28
31
 
29
- command = PROPAGATE_COMMAND; ///
32
+ command = PROPAGATE_COMMAND; ///
30
33
 
31
- argument = bottommostOldCurrentWorkingDirectoryName; ///
32
- }
34
+ argument = bottommostOldCurrentWorkingDirectoryName; ///
33
35
  }
34
36
  }
35
37
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "propagate-cli",
3
3
  "author": "James Smith",
4
- "version": "1.9.21",
4
+ "version": "1.9.22",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/propagate-cli",
7
7
  "description": "Propagate updated packages throughout a project.",