Skip to content

Commit 2eb3abd

Browse files
author
Michael Hladky
committed
refactor: wip
1 parent 983f1f8 commit 2eb3abd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/nx-plugin/src/executors/cli/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ import type {
1313
export function parseAutorunExecutorOnlyOptions(
1414
options: Partial<AutorunCommandExecutorOnlyOptions>,
1515
): AutorunCommandExecutorOnlyOptions {
16-
const { projectPrefix, dryRun, onlyPlugins, env } = options;
16+
const { projectPrefix, dryRun, onlyPlugins, env, bin } = options;
1717
return {
1818
...(projectPrefix && { projectPrefix }),
1919
...(dryRun != null && { dryRun }),
2020
...(onlyPlugins && { onlyPlugins }),
2121
...(env && { env }),
22+
...(bin && { bin }),
2223
};
2324
}
2425

packages/nx-plugin/src/executors/cli/utils.unit.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ describe('parseAutorunExecutorOnlyOptions', () => {
6565
parseAutorunExecutorOnlyOptions({ env: { TEST_ENV_VAR: '42' } }),
6666
).toStrictEqual(expect.objectContaining({ env: { TEST_ENV_VAR: '42' } }));
6767
});
68+
69+
it('should process given bin', () => {
70+
expect(parseAutorunExecutorOnlyOptions({ bin: 'index.js' })).toStrictEqual(
71+
expect.objectContaining({ bin: 'index.js' }),
72+
);
73+
});
6874
});
6975

7076
describe('parseAutorunExecutorOptions', () => {

packages/nx-plugin/src/executors/internal/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { ProjectConfiguration } from 'nx/src/config/workspace-json-project-
66
export type GeneralExecutorOnlyOptions = {
77
dryRun?: boolean;
88
env?: Record<string, string>;
9+
bin?: string;
910
};
1011

1112
/**
@@ -30,8 +31,6 @@ export type Command =
3031
| 'history';
3132
export type GlobalExecutorOptions = {
3233
command?: Command;
33-
bin?: string;
34-
env?: Record<string, string>;
3534
verbose?: boolean;
3635
config?: string;
3736
};

0 commit comments

Comments
 (0)