Skip to content

Commit

Permalink
chore: fix getting npmScope
Browse files Browse the repository at this point in the history
  • Loading branch information
Bielik20 committed Jan 20, 2023
1 parent de016ff commit 18e38b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/nx-npm/src/executors/publish/lib/normalize-options.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { ExecutorContext, readNxJson } from '@nrwl/devkit';
import { ExecutorContext } from '@nrwl/devkit';
import { getProjectConfiguration } from '@ns3/nx-core';
import { PublishExecutorNormalizedSchema, PublishExecutorSchema } from '../schema';

export function normalizeOptions(
options: PublishExecutorSchema,
context: ExecutorContext,
): PublishExecutorNormalizedSchema {
const nx = readNxJson();
const npmScope = context.workspace?.npmScope;

if (!npmScope) {
throw new Error('Missing npmScope in workspace');
}

return {
...options,
npmToken: getNpmToken(options),
pkgLocation: getPkgLocation(options, context),
npmScope: nx.npmScope,
npmScope: npmScope,
pkgVersion: options.pkgVersion || process.env['NPM_PACKAGE_VERSION'],
tag: options.tag || process.env['NPM_PACKAGE_TAG'] || 'latest',
};
Expand Down

0 comments on commit 18e38b3

Please sign in to comment.