propagate-cli 1.9.55 → 1.9.57

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
@@ -159,4 +159,4 @@ It is worth repeating that if you decide to terminate the update process entirel
159
159
 
160
160
  ## Contact
161
161
 
162
- - james.smith@djalbat.com
162
+ * james.smith@djalbat.com
package/bin/configure.js CHANGED
@@ -5,13 +5,11 @@ const { pathUtilities } = require("necessary");
5
5
  const { DOUBLE_DOTS } = require("./constants"),
6
6
  { DEFAULT_HELP, DEFAULT_VERSION } = require("./defaults"),
7
7
  { migrateConfigurationFile, checkConfigurationFileExists } = require("./configuration"),
8
- { HELP_COMMAND, VERSION_COMMAND, PROPAGATE_COMMAND, INITIALISE_COMMAND } = require("./commands");
8
+ { HELP_COMMAND, VERSION_COMMAND, INITIALISE_COMMAND, PROPAGATE_COMMAND } = require("./commands");
9
9
 
10
10
  const { bottommostNameFromPath } = pathUtilities;
11
11
 
12
12
  function configure(command, argument, options, main) {
13
- let configurationFileExists;
14
-
15
13
  const { help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
16
14
 
17
15
  if (false) {
@@ -28,27 +26,46 @@ function configure(command, argument, options, main) {
28
26
  return;
29
27
  }
30
28
 
31
- configurationFileExists = checkConfigurationFileExists();
29
+ const directoryName = changeDirectory(command);
30
+
31
+ if (directoryName !== null) {
32
+ if (command !== null) {
33
+ command = PROPAGATE_COMMAND;
34
+ }
35
+
36
+ argument = directoryName; ///
37
+ }
38
+
39
+ if (argument === null) {
40
+ argument = command; ///
32
41
 
33
- if (command === null) {
34
- if (!configurationFileExists) {
35
- const currentWorkingDirectoryPath = process.cwd(); ///
42
+ command = PROPAGATE_COMMAND;
43
+ }
36
44
 
37
- process.chdir(DOUBLE_DOTS);
45
+ main(command, argument, options);
46
+ }
38
47
 
39
- const oldCurrentWorkingDirectoryPath = currentWorkingDirectoryPath; ///
48
+ module.exports = configure;
40
49
 
50
+ function changeDirectory(command) {
51
+ let directoryName = null,
41
52
  configurationFileExists = checkConfigurationFileExists();
42
53
 
43
- if (configurationFileExists) {
44
- const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
54
+ if (!configurationFileExists) {
55
+ const currentWorkingDirectoryPath = process.cwd(); ///
56
+
57
+ process.chdir(DOUBLE_DOTS);
58
+
59
+ const oldCurrentWorkingDirectoryPath = currentWorkingDirectoryPath; ///
45
60
 
46
- argument = bottommostOldCurrentWorkingDirectoryName; ///
61
+ configurationFileExists = checkConfigurationFileExists();
47
62
 
48
- command = PROPAGATE_COMMAND; ///
49
- } else {
50
- process.chdir(oldCurrentWorkingDirectoryPath);
51
- }
63
+ if (configurationFileExists) {
64
+ const bottommostOldCurrentWorkingDirectoryName = bottommostNameFromPath(oldCurrentWorkingDirectoryPath);
65
+
66
+ directoryName = bottommostOldCurrentWorkingDirectoryName; ///
67
+ } else {
68
+ process.chdir(oldCurrentWorkingDirectoryPath);
52
69
  }
53
70
  }
54
71
 
@@ -56,7 +73,5 @@ function configure(command, argument, options, main) {
56
73
  migrateConfigurationFile();
57
74
  }
58
75
 
59
- main(command, argument, options);
76
+ return directoryName;
60
77
  }
61
-
62
- module.exports = configure;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "propagate-cli",
3
3
  "author": "James Smith",
4
- "version": "1.9.55",
4
+ "version": "1.9.57",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/propagate-cli",
7
7
  "description": "Propagate updated packages throughout a project.",