Skip to content

Commit

Permalink
fix(.nvmrc)
Browse files Browse the repository at this point in the history
closes #1051
  • Loading branch information
jhheider committed Nov 25, 2024
1 parent f28d931 commit 0e6faad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions fixtures/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^20.0.0
1 change: 1 addition & 0 deletions src/utils/devenv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Deno.test("devenv.ts", async runner => {
'pnpm.io@7.33.7',
],
[".node-version", "nodejs.org@16.16.0"],
[".nvmrc", "nodejs.org^20"],
["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"],
Expand Down
3 changes: 2 additions & 1 deletion src/utils/devenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export default async function(dir: Path) {
async function version_file(path: Path, project: string) {
let s = (await path.read()).trim()
if (s.startsWith('v')) s = s.slice(1) // v prefix has no effect but is allowed
s = `${project}@${s}`
if (s.match(/^[0-9]/)) s = `@${s}` // bare numbers are single versions
s = `${project}${s}`
pkgs.push(utils.pkg.parse(s))
}

Expand Down

0 comments on commit 0e6faad

Please sign in to comment.