Created
October 14, 2023 04:37
-
-
Save vernetto/ecd556e7f7043064995537a008623c4c to your computer and use it in GitHub Desktop.
git
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
const { execSync } = require('child_process'); | |
const versionPrefix = 'v23.11.03'; // Replace this with your desired prefix | |
try { | |
const latestTag = execSync(`git describe --tags --abbrev=0 --match "${versionPrefix}.[0-9]*" 2>/dev/null || true`, { encoding: 'utf-8' }); | |
console.log('Latest tag:', latestTag.trim()); | |
} catch (error) { | |
// Handle the error here if needed | |
console.error('Error:', error.message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment