fix: make bun resolve to given file path when an absolute path is given (#114)

* Make bun resolve to single file path when an absolute path is given

* Update test not to use the workspace folder
This commit is contained in:
Florian Barbare 2024-12-09 17:46:15 +00:00 committed by GitHub
parent 8f1bc2eeb3
commit f09eb1edd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -85,6 +85,10 @@ jobs:
file: package.json
run: |
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
- name: /foo/package.json (bun@1.1.0)
file: /foo/package.json
run: |
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > /foo/package.json
- name: package.json (yarn@bun@1.1.0)
file: package.json
run: |

View File

@ -1,7 +1,7 @@
import { debug, warning } from "@actions/core";
import { info } from "node:console";
import { existsSync, readFileSync, renameSync } from "node:fs";
import { join, basename } from "node:path";
import { resolve, basename } from "node:path";
export function retry<T>(
fn: () => Promise<T>,
@ -48,7 +48,7 @@ export function readVersionFromFile(file: string): string | undefined {
debug(`Reading version from ${file}`);
const path = join(cwd, file);
const path = resolve(cwd, file);
const base = basename(file);
if (!existsSync(path)) {