Skip to content

Commit

Permalink
Fix Project Path Flag Issue (#823)
Browse files Browse the repository at this point in the history
* Fix project path flag issue

* version: [email protected]

---------

Co-authored-by: Joe Clark <[email protected]>
  • Loading branch information
elias-ba and josephjclark authored Nov 12, 2024
1 parent 21b66c4 commit 6b6ff2d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @openfn/cli

## 1.8.8

### Patch Changes

- 1f13d8f: Resolved an issue where the `-p` (project path) flag was ignored in the `deploy` command, causing the CLI to default to `project.yaml` instead of the specified file.

## 1.8.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/cli",
"version": "1.8.7",
"version": "1.8.8",
"description": "CLI devtools for the openfn toolchain.",
"engines": {
"node": ">=18",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/deploy/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function mergeOverrides(
apiKey: pickFirst(process.env['OPENFN_API_KEY'], config.apiKey),
endpoint: pickFirst(process.env['OPENFN_ENDPOINT'], config.endpoint),
statePath: pickFirst(options.statePath, config.statePath),
specPath: pickFirst(options.projectPath, config.specPath),
configPath: options.configPath,
requireConfirmation: pickFirst(options.confirm, config.requireConfirmation),
};
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/test/deploy/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ test('pass a config path (shortform)', (t) => {
const options = parse('deploy -c other_config.json');
t.deepEqual(options.configPath, 'other_config.json');
});

test('pass a spec path (longform)', (t) => {
const options = parse('deploy --project-path test-project.yaml');
t.deepEqual(options.projectPath, 'test-project.yaml');
});

test('pass a spec path (shortform)', (t) => {
const options = parse('deploy -p test-project.yaml');
t.deepEqual(options.projectPath, 'test-project.yaml');
});

0 comments on commit 6b6ff2d

Please sign in to comment.