Skip to content

Commit

Permalink
scripts: fix tar esm issue (#48442)
Browse files Browse the repository at this point in the history
* Update build.ts

Signed-off-by: vagusX <vagusxl@gmail.com>

* Update build.ts

Signed-off-by: vagusX <vagusxl@gmail.com>

---------

Signed-off-by: vagusX <vagusxl@gmail.com>
  • Loading branch information
vagusX committed Apr 14, 2024
1 parent 72b5263 commit 0072587
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/visual-regression/build.ts
Expand Up @@ -16,7 +16,6 @@ import { remark } from 'remark';
import remarkGfm from 'remark-gfm';
import remarkHtml from 'remark-html';
import sharp from 'sharp';
import tar from 'tar';

const ROOT_DIR = process.cwd();
const ALI_OSS_BUCKET = 'antd-visual-diff';
Expand Down Expand Up @@ -106,6 +105,7 @@ async function getBranchLatestRef(branchName: string) {
}

async function downloadBaseSnapshots(ref: string, targetDir: string) {
const tar = await import('tar');
// download imageSnapshotsUrl
const imageSnapshotsUrl = `${ossDomain}/${ref}/imageSnapshots.tar.gz`;
const targzPath = path.resolve(os.tmpdir(), `./${path.basename(targetDir)}.tar.gz`);
Expand Down Expand Up @@ -350,7 +350,7 @@ async function boot() {
htmlTemplate.replace('{{reportContent}}', reportHtmlStr),
'utf-8',
);

const tar = await import('tar');
await tar.c(
{
gzip: true,
Expand Down

0 comments on commit 0072587

Please sign in to comment.