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 be741f7
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 => {
'[email protected]',
],
[".node-version", "[email protected]"],
[".nvmrc", "nodejs.org^20"],
["python-version/std/.python-version", "python.org~3.10"],
["python-version/commented/.python-version", "python.org~3.11"],
[".ruby-version", "[email protected]"],
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 (isNumber(s.slice(0, 1))) s = `@${s}` // bare numbers are single versions
s = `${project}${s}`
pkgs.push(utils.pkg.parse(s))
}

Expand Down

0 comments on commit be741f7

Please sign in to comment.