Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Make --output flag support all types of paths #9169

Merged
merged 5 commits into from
Dec 5, 2023

Conversation

mosmartin
Copy link
Contributor

What was the problem?

This PR resolves #9090

How was it solved?

Created the handleOutputFlag utility function.
With this utiliy, it's now possible to generate output files with following commands

  1. ./bin/run generator export will generate a file with the default namespace name in the cwd.
  2. ./bin/run generator export --output . will generate a file with the default namespace name in the cwd.
  3. ./bin/run generator export --output ./ will generate a file with the default namespace name in the cwd.
  4. ./bin/run generator export --output test.json will generate the file with the provided filename in the cwd.
  5. ./bin/run generator export --output ~ will generate a file with the default namespace name in the user home dir.
  6. ./bin/run generator export --output ~/Desktop/ will generate a file with the default namespace name in the user desktop.
  7. ./bin/run generator export --output exports will generate a file with the default namespace name in the defined dir (exports) in cwd
  8. ./bin/run generator export --output /Users/johndoe/Public/test.json will generate the test.json file in the defined path

How was it tested?

Updated and added new tests

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Merging #9169 (f92b2c5) into release/6.1.0 (f641009) will decrease coverage by 0.01%.
The diff coverage is 93.22%.

❗ Current head f92b2c5 differs from pull request most recent head 4500f0b. Consider uploading reports for the commit 4500f0b to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release/6.1.0    #9169      +/-   ##
=================================================
- Coverage          84.65%   84.65%   -0.01%     
=================================================
  Files                655      656       +1     
  Lines              24113    24122       +9     
  Branches            3497     3497              
=================================================
+ Hits               20414    20420       +6     
- Misses              3699     3702       +3     
Files Coverage Δ
...der/src/bootstrapping/commands/generator/export.ts 91.30% <100.00%> (-1.29%) ⬇️
commander/src/bootstrapping/commands/hash-onion.ts 82.75% <100.00%> (-3.36%) ⬇️
...ommander/src/bootstrapping/commands/keys/create.ts 100.00% <100.00%> (ø)
...ommander/src/bootstrapping/commands/keys/export.ts 94.73% <100.00%> (-0.51%) ⬇️
...er/src/bootstrapping/commands/passphrase/create.ts 100.00% <100.00%> (ø)
...r/src/bootstrapping/commands/passphrase/encrypt.ts 100.00% <100.00%> (ø)
commander/src/utils/flags.ts 100.00% <ø> (ø)
commander/src/utils/output.ts 100.00% <100.00%> (ø)
...mander/src/bootstrapping/commands/config/create.ts 34.28% <20.00%> (-2.08%) ⬇️

... and 1 file with indirect coverage changes

@mosmartin mosmartin self-assigned this Nov 30, 2023
@mosmartin mosmartin requested a review from ishantiw December 5, 2023 13:00
@ishantiw ishantiw enabled auto-merge (squash) December 5, 2023 14:07
@ishantiw ishantiw merged commit 733e028 into release/6.1.0 Dec 5, 2023
9 checks passed
@ishantiw ishantiw deleted the 9090-create-output-flag-util branch December 5, 2023 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants