@opencode/util 0.0.0-dev-957 → 0.0.0-dev-960
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/npm.d.ts +1 -0
- package/dist/npm.js +10 -0
- package/package.json +1 -1
package/dist/npm.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare const InstallFailedError_base: Schema.Class<InstallFailedError, Schema.T
|
|
|
7
7
|
readonly cause: Schema.optional<Schema.Defect>;
|
|
8
8
|
}>, import("effect/Cause").YieldableError>;
|
|
9
9
|
export declare class InstallFailedError extends InstallFailedError_base {
|
|
10
|
+
get message(): string;
|
|
10
11
|
}
|
|
11
12
|
export interface Package {
|
|
12
13
|
readonly directory: string;
|
package/dist/npm.js
CHANGED
|
@@ -13,6 +13,16 @@ export class InstallFailedError extends Schema.TaggedError()("NpmInstallFailedEr
|
|
|
13
13
|
dir: Schema.String,
|
|
14
14
|
cause: Schema.optional(Schema.Defect()),
|
|
15
15
|
}) {
|
|
16
|
+
get message() {
|
|
17
|
+
const summary = `Failed to install ${this.add?.join(", ") || this.dir}`;
|
|
18
|
+
if (!(this.cause instanceof Error))
|
|
19
|
+
return summary;
|
|
20
|
+
// @npmcli/git reports most failures as "An unknown git error occurred" and keeps git's output on `stderr`.
|
|
21
|
+
const stderr = "stderr" in this.cause && typeof this.cause.stderr === "string" ? this.cause.stderr.trim() : "";
|
|
22
|
+
if (!stderr)
|
|
23
|
+
return `${summary}: ${this.cause.message}`;
|
|
24
|
+
return `${summary}: ${this.cause.message}\n${stderr}`;
|
|
25
|
+
}
|
|
16
26
|
}
|
|
17
27
|
export class Service extends Context.Service()("@opencode/Npm") {
|
|
18
28
|
}
|