Last active
May 19, 2021 19:53
-
-
Save seanwash/968786b1152cecf1af254d10b2cbe0fb to your computer and use it in GitHub Desktop.
NPM Check Package Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zx | |
// Don't output every command run. | |
$.verbose = false | |
let TARGET_BRANCH = await question('Which branch do you want to check? (develop) ') | |
TARGET_BRANCH = TARGET_BRANCH || 'develop' | |
const originalBranch = await $`git branch --show-current` | |
await $`git checkout ${TARGET_BRANCH}` | |
const version = await require('../package.json').version | |
console.log(`${TARGET_BRANCH}:`, version) | |
await $`git checkout ${originalBranch}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment