This commit is contained in:
parent
2194bf199e
commit
1b7c4847dc
@ -1,4 +1,5 @@
|
|||||||
export * as S3 from "https://deno.land/x/s3@0.2.0/mod.ts";
|
export * as S3 from "https://deno.land/x/s3@0.2.0/mod.ts";
|
||||||
|
export { S3Error } from "https://deno.land/x/s3@0.2.0/src/error.ts";
|
||||||
|
|
||||||
export * as Ini from "https://deno.hibas123.de/raw/ini@0.0.1/mod.ts";
|
export * as Ini from "https://deno.hibas123.de/raw/ini@0.0.1/mod.ts";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ABC, Path, Compress, FS, Colors } from "../deps.ts";
|
import { ABC, Path, Compress, FS, Colors, S3Error } from "../deps.ts";
|
||||||
|
|
||||||
import bucket from "../s3.ts";
|
import bucket from "../s3.ts";
|
||||||
import { isValidPackageName, basicauth, isValidFullVersion } from "../utils.ts";
|
import { isValidPackageName, basicauth, isValidFullVersion } from "../utils.ts";
|
||||||
@ -145,7 +145,7 @@ async function uploadPackage(ctx: ABC.Context) {
|
|||||||
const bucketPath = (bucketBase + relative).replace(/@/g, "§");
|
const bucketPath = (bucketBase + relative).replace(/@/g, "§");
|
||||||
|
|
||||||
const body = await Deno.readAll(await Deno.open(file.path));
|
const body = await Deno.readAll(await Deno.open(file.path));
|
||||||
console.log("Put Object", bucketPath);
|
console.log("Put Object", bucketPath, body.byteLength);
|
||||||
await bucket.putObject(bucketPath, body, {});
|
await bucket.putObject(bucketPath, body, {});
|
||||||
}
|
}
|
||||||
console.log("Setting new live version");
|
console.log("Setting new live version");
|
||||||
@ -171,6 +171,7 @@ async function uploadPackage(ctx: ABC.Context) {
|
|||||||
Colors.red("Error while processing newly uploaded package")
|
Colors.red("Error while processing newly uploaded package")
|
||||||
);
|
);
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
if (err instanceof S3Error) console.log(err.response);
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
message: err.message,
|
message: err.message,
|
||||||
|
Loading…
Reference in New Issue
Block a user