ump 3.2.0 → 3.3.0

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/lib/commands.js CHANGED
@@ -28,13 +28,13 @@ const commands = {
28
28
  // Need to pull before mucking with files, so we can stop it if git branch isn't clean.
29
29
  // Otherwise files will be bumped and committed but not pushed and things will get messed up.
30
30
  // **We can autostash on pull because we handle existence of uncommitted files later
31
- const pullAutostash = 'git pull --autostash';
31
+ const pull = opts.autostash ? 'git pull --autostash' : 'git pull';
32
32
 
33
33
  return {
34
- log: pullAutostash,
34
+ log: pull,
35
35
  cmd: function() {
36
36
 
37
- return exec(pullAutostash)
37
+ return exec(pull)
38
38
  .then(({stdout, stderr}) => {
39
39
  console.log(stdout);
40
40
 
@@ -45,7 +45,7 @@ const commands = {
45
45
  utils.error(config.messages.gitPull);
46
46
  }
47
47
  } else {
48
- log.color(`Executed ${pullAutostash}`, 'cyan');
48
+ log.color(`Executed ${pull}`, 'cyan');
49
49
  }
50
50
  })
51
51
  .catch((err) => {
package/lib/config.js CHANGED
@@ -16,6 +16,7 @@ const config = {
16
16
  regexPrefix: '(?:\\-\\sv|version[\'"]?\\:\\s*[\'"])',
17
17
  regexReplace: '(?:[0-9]+\\.){2}[0-9]+[0-9a-zA-Z\\-_\\+\\.]*',
18
18
  regexFlags: 'g',
19
+ autostash: true,
19
20
  },
20
21
 
21
22
  messages: {
@@ -93,6 +94,12 @@ Object.assign(config, {
93
94
  description: 'If set, ump will run in debug mode, outputting a json file instead of doing something',
94
95
  type: 'boolean',
95
96
  },
97
+ a: {
98
+ alias: 'autostash',
99
+ description: 'Whether to use the --autostash flag when running `git pull`',
100
+ type: 'boolean',
101
+ default: true,
102
+ },
96
103
  extras: {
97
104
  description: 'Array of objects. ONLY AVAILABLE VIA .umprc OR when using ump() AS MODULE. Props: file, prefix (optional regex string), replaced (optional regex string), flags (optional). See https://github.com/kswedberg/ump/blob/master/README.md for more info.',
98
105
  },
package/lib/utils.js CHANGED
@@ -257,7 +257,7 @@ const peach = (arr, fn) => {
257
257
  const called = func();
258
258
  // If the function doesn't return a "then-able", create one with Promise.resolve():
259
259
 
260
- return (typeof called.then === 'function' ? called : Promise.resolve(called))
260
+ return (called && typeof called.then === 'function' ? called : Promise.resolve(called))
261
261
  .then([].concat.bind(result));
262
262
  });
263
263
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ump",
3
3
  "title": "ump",
4
- "version": "3.2.0",
4
+ "version": "3.3.0",
5
5
  "description": "Bump without the B",
6
6
  "scripts": {
7
7
  "test": "npm run test:clean && npm run test:pre && npm run test:run",