Skip to content

Commit

Permalink
fix: update dry run command output to match new entrypoints work
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Sep 1, 2020
1 parent ed11aac commit 9f18d1f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions classes/publish/package/tasks/dry-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

'use strict';

const {join} = require('path');
const Task = require('./task');
const { entrypoints: mapEntrypoints } = require('../../../../utils');

module.exports = class DryRun extends Task {
async process(incoming = {}, outgoing = {}) {
const { dryRun, path, zipFile, entrypoints } = incoming;
const { dryRun, path, zipFile, entrypoints, cwd } = incoming;
if (dryRun) {
outgoing.files = [
{ pathname: path, type: 'temporary directory' },
{ pathname: zipFile, type: 'package archive' },
]

for (const key of Object.keys(entrypoints)) {
outgoing.files.push({ pathname: join(path, key), type: 'package file' })
const files = await mapEntrypoints(entrypoints, path, { cwd });

for (const [, dest] of files) {
outgoing.files.push({ pathname: dest, type: 'package file' });
}
}

Expand Down

0 comments on commit 9f18d1f

Please sign in to comment.