Skip to content

Commit

Permalink
Add test coverage for .terraform-version and fix the terraform versio…
Browse files Browse the repository at this point in the history
…n resolution logic
  • Loading branch information
kishaningithub committed Oct 27, 2023
1 parent 96c5a10 commit eb12979
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions fixtures/.terraform-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.6.1
1 change: 1 addition & 0 deletions src/utils/devenv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Deno.test("devenv.ts", async runner => {
["python-version/std/.python-version", "python.org~3.10"],
["python-version/commented/.python-version", "python.org~3.11"],
[".ruby-version", "ruby-lang.org@3.2.1"],
[".terraform-version", "terraform.io@1.6.1"],
["yarn.lock", "yarnpkg.com"],
["bun.lockb", "bun.sh>=1"],
["pyproject.toml/poetry-yaml-fm/pyproject.toml", "pip.pypa.io", "python~3.10"],
Expand Down
3 changes: 2 additions & 1 deletion src/utils/devenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ export default async function(dir: Path) {

async function terraform_version(path: Path) {
const terraform_version = (await path.read()).trim()
pkgs.push(utils.pkg.parse(terraform_version))
const package_descriptor = `terraform.io@${terraform_version}`
pkgs.push(utils.pkg.parse(package_descriptor))
}

async function package_json(path: Path) {
Expand Down

0 comments on commit eb12979

Please sign in to comment.