Skip to content

Commit

Permalink
fix: make bun resolve to given file path when an absolute path is giv…
Browse files Browse the repository at this point in the history
…en (#114)

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

* Update test not to use the workspace folder
  • Loading branch information
fbarbare authored Dec 9, 2024
1 parent 8f1bc2e commit f09eb1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
file: package.json
run: |
echo "$(jq '. += {"packageManager": "[email protected]"}' package.json)" > package.json
- name: /foo/package.json ([email protected])
file: /foo/package.json
run: |
echo "$(jq '. += {"packageManager": "[email protected]"}' package.json)" > /foo/package.json
- name: package.json (yarn@[email protected])
file: package.json
run: |
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -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>,
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit f09eb1e

Please sign in to comment.