Skip to content

Commit

Permalink
fix(publish): Fix error when special target 'all' is used
Browse files Browse the repository at this point in the history
Fixes #141, follow up to #137 where there was a forgotten negation causing this issue.

Tests will follow in a separate PR.
  • Loading branch information
BYK committed Dec 1, 2020
1 parent 2fb243b commit 2ef4443
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.13.4

- fix(publish): Fix error when special target 'all' is used

## 0.13.3

- fix(publish): Only allow valid target ids for -t (#137)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ export async function publishMain(argv: PublishOptions): Promise<any> {

let targetConfigList = config.targets || [];

if (targetList.has(SpecialTarget.All)) {
if (!targetList.has(SpecialTarget.All)) {
targetConfigList = targetConfigList.filter(targetConf =>
targetList.has(getTargetId(targetConf))
);
}

if (!targetList.has(SpecialTarget.None)) {
if (!targetConfigList.length) {
if (targetConfigList.length === 0) {
logger.warn('No valid targets detected! Exiting.');
return undefined;
}
Expand Down

0 comments on commit 2ef4443

Please sign in to comment.