diff --git a/fixtures/.nvmrc b/fixtures/.nvmrc new file mode 100644 index 00000000..6701850f --- /dev/null +++ b/fixtures/.nvmrc @@ -0,0 +1 @@ +^20.0.0 \ No newline at end of file diff --git a/src/utils/devenv.test.ts b/src/utils/devenv.test.ts index 06df67c3..effd4837 100644 --- a/src/utils/devenv.test.ts +++ b/src/utils/devenv.test.ts @@ -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"], diff --git a/src/utils/devenv.ts b/src/utils/devenv.ts index f39681a5..b63b3976 100644 --- a/src/utils/devenv.ts +++ b/src/utils/devenv.ts @@ -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)) }