Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patchversion scripting command #727

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

giacomofiorin
Copy link
Member

@giacomofiorin giacomofiorin commented Oct 11, 2024

A NAMD patch release is upcoming, which may also contain bugfixes for Colvars. However, the Colvars version is not being updated in it, which makes it difficult to detect in script if a given bug has been fixed or not.

The new command cv patchversion allows to retrieve the patch version in scripts.

Example use in a NAMD script:

set colvars_version ""
set colvars_patch_version 0
catch { set colvars_version [cv version] }
if { ${colvars_version} != "" } {
    catch { set colvars_patch_version [cv patchversion] }
} else {
    puts stderr "Error: cannot get Colvars version"
}

if { ${colvars_patch_version} > 0 } {
    puts "Colvars version: ${colvars_version} (patch ${colvars_patch_version}): some nasty bugs have been fixed"
} else {
    puts "Colvars version: ${colvars_version}: some nasty bugs are still in there!"
}

@giacomofiorin giacomofiorin added the script_API Control Colvars from scripts label Oct 11, 2024
@giacomofiorin giacomofiorin merged commit 37fb8df into master Oct 11, 2024
14 checks passed
@giacomofiorin giacomofiorin deleted the patchversion-script branch October 11, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
script_API Control Colvars from scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant