mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-22 17:50:13 +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
|
file: package.json
|
||||||
run: |
|
run: |
|
||||||
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
|
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)
|
- name: package.json (yarn@bun@1.1.0)
|
||||||
file: package.json
|
file: package.json
|
||||||
run: |
|
run: |
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { debug, warning } from "@actions/core";
|
import { debug, warning } from "@actions/core";
|
||||||
import { info } from "node:console";
|
import { info } from "node:console";
|
||||||
import { existsSync, readFileSync, renameSync } from "node:fs";
|
import { existsSync, readFileSync, renameSync } from "node:fs";
|
||||||
import { join, basename } from "node:path";
|
import { resolve, basename } from "node:path";
|
||||||
|
|
||||||
export function retry<T>(
|
export function retry<T>(
|
||||||
fn: () => Promise<T>,
|
fn: () => Promise<T>,
|
||||||
@ -48,7 +48,7 @@ export function readVersionFromFile(file: string): string | undefined {
|
|||||||
|
|
||||||
debug(`Reading version from ${file}`);
|
debug(`Reading version from ${file}`);
|
||||||
|
|
||||||
const path = join(cwd, file);
|
const path = resolve(cwd, file);
|
||||||
const base = basename(file);
|
const base = basename(file);
|
||||||
|
|
||||||
if (!existsSync(path)) {
|
if (!existsSync(path)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user