@aaronshaf/ger 1.1.0 → 1.2.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.
@@ -1,3 +1,5 @@
1
+ const {execSync} = require('child_process')
2
+
1
3
  // Extract local branch names
2
4
  const stdout = execSync(
3
5
  `git for-each-ref --sort=committerdate refs/heads/ --format='%(refname:lstrip=2)' | grep -v '^master$'`
@@ -28,6 +30,12 @@ localBranches.forEach(branch => {
28
30
  }
29
31
  })
30
32
 
33
+ // if query is empty
34
+ if (!query) {
35
+ console.log('No change IDs found')
36
+ process.exit(0)
37
+ }
38
+
31
39
  // Remove the trailing " OR "
32
40
  query = query.replace(/ OR $/, '')
33
41
 
package/ger.js CHANGED
@@ -1,5 +1,4 @@
1
- import {execSync} from 'child_process'
2
- import branch from './branch.js'
1
+ const branch = require('./commands/branch.js')
3
2
 
4
3
  if (process.argv[2] === 'branch') {
5
4
  branch()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaronshaf/ger",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Gerrit CLI",
5
5
  "main": "ger.js",
6
6
  "bin": {