* Fix S3

* get rid of fsextra
This commit is contained in:
Peter Hedenskog 2023-03-06 13:32:18 +01:00 committed by GitHub
parent 305c5fdc7c
commit 26e9026106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -1,14 +1,16 @@
import { relative, join, resolve as _resolve, sep } from 'node:path';
import fs from 'fs-extra/esm';
import { Endpoint, S3 } from 'aws-sdk';
import fs from 'node:fs';
import aws from 'aws-sdk';
const { Endpoint, S3 } = aws;
import readdir from 'recursive-readdir';
import pLimit from 'p-limit';
import intel from 'intel';
import { SitespeedioPlugin } from '@sitespeed.io/plugin';
import { throwIfMissing } from '../../support/util';
import { getContentType } from './contentType';
import { throwIfMissing } from '../../support/util.js';
import { getContentType } from './contentType.js';
const log = intel.getLogger('sitespeedio.plugin.s3');
@ -130,7 +132,7 @@ export default class S3Plugin extends SitespeedioPlugin {
}
log.info('Finished upload to s3');
if (s3Options.removeLocalResult) {
await fs.remove(baseDir);
fs.rmSync(baseDir, { recursive: true });
log.debug(`Removed local files and directory ${baseDir}`);
}
} catch (error) {