Skip to content

Commit 8df1f0b

Browse files
authored
Merge pull request #11 from pkgxdev/fix-nvmrc
fix .nvmrc versions
2 parents c916a4c + 9ff31da commit 8df1f0b

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ environment. We recommend Visual Studio Code, `dev && code .` works great.
142142
143143
> [!WARNING]
144144
>
145-
> Unfortunately, this usually means you *must* open your editor via your
145+
> Unfortunately, this usually means you _must_ open your editor via your
146146
> terminal.
147147
148148
## GitHub Actions

fixtures/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
^20

src/sniff.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Deno.test("devenv.ts", async (runner) => {
9292
"pnpm.io@7.33.7",
9393
],
9494
[".node-version", "nodejs.org@16.16.0"],
95+
[".nvmrc", "nodejs.org^20"],
9596
["python-version/std/.python-version", "python.org~3.10"],
9697
["python-version/commented/.python-version", "python.org~3.11"],
9798
[".ruby-version", "ruby-lang.org@3.2.1"],

src/sniff.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export default async function (dir: Path) {
162162
async function version_file(path: Path, project: string) {
163163
let s = (await path.read()).trim();
164164
if (s.startsWith("v")) s = s.slice(1); // v prefix has no effect but is allowed
165-
s = `${project}@${s}`;
165+
if (s.match(/^[0-9]/)) s = `@${s}`; // bare versions are `@`ed
166+
s = `${project}${s}`;
166167
pkgs.push(utils.pkg.parse(s));
167168
}
168169

0 commit comments

Comments
 (0)