From d24dac248551d1655bded7365d225870d52c7718 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Thu, 20 Jun 2024 22:49:23 +0800 Subject: [PATCH] chore: reduce the docker images. --- plugins/uploader.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/uploader.ts b/plugins/uploader.ts index 247d31e..3545cb2 100644 --- a/plugins/uploader.ts +++ b/plugins/uploader.ts @@ -4,6 +4,7 @@ import type { AstroIntegration, AstroIntegrationLogger } from 'astro'; import { z } from 'astro/zod'; import fs from 'node:fs'; import path from 'node:path'; +import { rimrafSync } from 'rimraf'; const S3Options = z.object({ paths: z.array(z.string()).min(1), @@ -54,6 +55,7 @@ export const uploader = (opts: z.input): AstroIntegration => ( for (const current of paths) { await uploadFile(client, logger, bucket, current, dir.pathname); + rimrafSync(path.join(dir.pathname, current)); } logger.info('Upload all the files successfully.');