Skip to content

Commit

Permalink
Bind tasks' run function to prevent loosing this context (elastic#35933
Browse files Browse the repository at this point in the history
…) (elastic#35936)

* Bind tasks' run function to prevent loosing this context

* Add .node_binaries to build cleanup too

.node_binaries were previously added to yarn kbn cleanup but this
is different than the cleanup task that gets run as part of the
build.
  • Loading branch information
rudolf authored May 2, 2019
1 parent 15549e3 commit c716a32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dev/build/tasks/clean_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const CleanTask = {
await deleteAll([
config.resolveFromRepo('build'),
config.resolveFromRepo('target'),
config.resolveFromRepo('.node_binaries'),
], log);
},
};
Expand Down
6 changes: 5 additions & 1 deletion src/dev/build/tasks/nodejs/extract_node_builds_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const statAsync = promisify(fs.stat);
const mkdirpAsync = promisify(mkdirp);
const copyFileAsync = promisify(fs.copyFile);

export const ExtractNodeBuildsTask = {
const ExtractNodeBuildsTask = {
global: true,
description: 'Extracting node.js builds for all platforms',
async run(config) {
Expand All @@ -55,3 +55,7 @@ export const ExtractNodeBuildsTask = {
return await copyFileAsync(source, destination, fs.constants.COPYFILE_FICLONE);
},
};

ExtractNodeBuildsTask.run = ExtractNodeBuildsTask.run.bind(ExtractNodeBuildsTask);

export { ExtractNodeBuildsTask };

0 comments on commit c716a32

Please sign in to comment.