Skip to content

Commit

Permalink
Only run npm pack if there are public packages in workspace (#522)
Browse files Browse the repository at this point in the history
* Only run npm pack if there are public packages in workspace

* Add warning if workspaces does not contain public package

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fcollonval and pre-commit-ci[bot] authored Oct 17, 2023
1 parent 69f4987 commit 8bd91cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions jupyter_releaser/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ def build_dist(package, dist_dir):
if data.get("private", False):
continue
paths.append(str(osp.abspath(path)).replace(os.sep, "/"))

util.run(f"npm pack {' '.join(paths)}", cwd=dest, quiet=True)
if paths:
util.run(f"npm pack {' '.join(paths)}", cwd=dest, quiet=True)
else:
util.log(
"The NPM package defines 'workspaces' that does not contain any public package; this may be a mistake."
)


def extract_dist(dist_dir, target):
Expand Down

0 comments on commit 8bd91cc

Please sign in to comment.