From edad4e63dff0ca0b19a264fc17e8b6a5315dfb04 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Wed, 12 Mar 2014 19:22:32 +0000 Subject: chore(version-info): better error msg if not tags --- lib/versions/version-info.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/versions/version-info.js b/lib/versions/version-info.js index 588f1865..90175fc9 100644 --- a/lib/versions/version-info.js +++ b/lib/versions/version-info.js @@ -136,6 +136,12 @@ var getSnapshotVersion = function() { }) .last(); + if ( !version ) { + throw new Error("No valid versions can be found that match the current branch (" + + currentPackage.branchVersion + ").\n" + + "Try running `git fetch -t` to download the tags from the repository."); + } + // We need to clone to ensure that we are not modifying another version version = semver(version.raw); -- cgit v1.2.3