Conversation
The `retrieve` command with `-o -` should write to stdout. However, this was not working due to a small typo in which the `tmpFile` variable was not being assigned a value, so the stdout wasnt executing. This was due to the usage of `:=` over `=` within a conditional block scope.
|
@brunocalza not sure how i missed this...it was originally working when i wrote that code, but i must've accidentally changed the assignment operator before this got merged. just double checking—do we have tests set up? if so, i could make sure there's one for this command flag. (i'm not as familiar with go so didn't want to mess with anything.) |
This repo is lacking in tests, because it's hard to implement tests for CLI :( but we can think of a way for sure, just didn't want to spend too much time on that since the directions of the project wasn't clear |
Summary
Fixes a bug where
vaults retrieve -o - ...fails.Details
The
retrievecommand with-o -should write to stdout. However, this was not working due to a small operator typo in which thetmpFilevariable was not being assigned a value, so the write to stdout wasn't executing becausetmpFilewas seen asnil. This was due to the usage of:=over=within a conditional block scope.How it was tested
Build & then run
vaults retrieve --output - bafybeigpvzdvjgde5a6ayj7265a6ns3i4mvhhr6pqtlebpil5imkeh4ncy | car extractto pipe the output to car extract, which unpacks the car file from stdout successfully.