Skip to content

Commit

Permalink
fix: add dry-run option to publish target (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvieirasilva authored Sep 18, 2024
1 parent de48f22 commit 1756447
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/nx-python/src/executors/publish/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@ export default async function executor(
chalk`\n {bold Publishing project {bgBlue ${context.projectName} }...}\n`,
);

await runPoetry(['publish', ...(options.__unparsed__ ?? [])], {
cwd: buildFolderPath,
});
await runPoetry(
[
'publish',
...(options.dryRun ? ['--dry-run'] : []),
...(options.__unparsed__ ?? []),
],
{
cwd: buildFolderPath,
},
);

removeSync(buildFolderPath);

Expand Down
1 change: 1 addition & 0 deletions packages/nx-python/src/executors/publish/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface PublishExecutorSchema {
silent: boolean;
buildTarget: string;
dryRun: boolean;
__unparsed__?: string[];
}
5 changes: 5 additions & 0 deletions packages/nx-python/src/executors/publish/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"description": "Hide output text.",
"default": false
},
"dryRun": {
"type": "boolean",
"description": "Do not publish the package.",
"default": false
},
"__unparsed__": {
"hidden": true,
"type": "array",
Expand Down

0 comments on commit 1756447

Please sign in to comment.