Skip to content

Commit

Permalink
use versionConstraints correctly, strip the v
Browse files Browse the repository at this point in the history
Signed-off-by: James Humphries <[email protected]>
  • Loading branch information
Yantrio committed Sep 10, 2024
1 parent 55ba145 commit fc6ef3d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ export function ProviderInstructionSidebarBlock() {

const { data } = useSuspenseQuery(getProviderDataQuery(namespace, provider));

// strip the v from the version to display in the provider instructions
// e.g. v0.1.0 -> 0.1.0
const versionConstraint = version.replace(/^v/, "");

const instruction = `terraform {
required_providers {
${data.addr.name} = {
source = "${data.addr.namespace}/${data.addr.name}"
version = "${version}"
version = "${versionConstraint}"
}
}
}
Expand Down

0 comments on commit fc6ef3d

Please sign in to comment.