mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-22 09:40:12 +08:00
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:
parent
8f1bc2eeb3
commit
f09eb1edd0
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -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: |
|
||||
|
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user