function tagExists(version) {
    if (! version) {
        throw new Error("invalid version");
    }

    let res = childProcess.spawnSync("git", [ "tag", "-l", version ]);

    return res.stdout.toString().trim() === version;
}
Check if a tag exists for the specified version
@param {string} version Version to check
@returns {boolean} Does the tag already exist
@throws Version is not valid