Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop mkdrip dependency #8183

Merged
merged 2 commits into from Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/plugins/aws/invokeLocal/index.js
Expand Up @@ -12,7 +12,7 @@ const spawnExt = require('child-process-ext/spawn');
const { spawn } = require('child_process');
const inspect = require('util').inspect;
const download = require('download');
const mkdirp = require('mkdirp');
const { ensureDir } = require('fs-extra');
const cachedir = require('cachedir');
const decompress = require('decompress');
const dirExists = require('../../../utils/fs/dirExists');
Expand All @@ -21,8 +21,6 @@ const isStandalone = require('../../../utils/isStandaloneExecutable');
const getEnsureArtifact = require('../../../utils/getEnsureArtifact');
const resolveCfImportValue = require('../utils/resolveCfImportValue');

const mkdirpAsync = BbPromise.promisify(mkdirp);

const cachePath = path.join(cachedir('serverless'), 'invokeLocal');

const ensureRuntimeWrappers = isStandalone
Expand Down Expand Up @@ -332,7 +330,7 @@ class AwsInvokeLocal {
return dirExists(layerContentsCachePath).then(cacheExists => {
if (!cacheExists) {
this.serverless.cli.log(`Downloading layer ${layer}...`);
return mkdirpAsync(path.join(layerContentsCachePath))
return ensureDir(path.join(layerContentsCachePath))
.then(() =>
this.provider.request('Lambda', 'getLayerVersion', {
LayerName: layerArn,
Expand Down Expand Up @@ -388,8 +386,8 @@ class AwsInvokeLocal {
return imageName;
}
return BbPromise.all([
mkdirpAsync(path.join('.serverless', 'invokeLocal', runtime)),
mkdirpAsync(path.join(cachePath, 'dockerfiles', runtime)),
ensureDir(path.join('.serverless', 'invokeLocal', runtime)),
ensureDir(path.join(cachePath, 'dockerfiles', runtime)),
])
.then(() => {
this.serverless.cli.log('Writing Dockerfile...');
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/package/lib/packageService.test.js
Expand Up @@ -658,7 +658,7 @@ describe('#packageService()', () => {

return expect(
packagePlugin.resolveFilePathsFromPatterns(params)
).to.be.fulfilled.then(actual => expect(actual).to.deep.equal(expected));
).to.be.fulfilled.then(actual => expect(actual.sort()).to.deep.equal(expected.sort()));
});
});
});
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -57,7 +57,6 @@
"lodash": "^4.17.20",
"memoizee": "^0.4.14",
"micromatch": "^4.0.2",
"mkdirp": "^0.5.4",
"ncjsm": "^4.1.0",
"node-fetch": "^2.6.0",
"object-hash": "^2.0.3",
Expand Down