mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
actually honor provided stdin/stdout
the BackupTar and RestoreTar functionality was ignoring provided readers, which doesn't matter for real usage but breaks tests by making them dump raw tar binaries to stdout.
This commit is contained in:
parent
c681642734
commit
93153a97db
2 changed files with 6 additions and 5 deletions
|
|
@ -127,7 +127,7 @@ func (cmd *BackupTarCommand) Run(ctx context.Context) (err error) {
|
|||
// Create output file in temporary location, or send to stdout if a dash is specified.
|
||||
var w io.Writer
|
||||
if useStdout {
|
||||
w = os.Stdout
|
||||
w = cmd.Stdout
|
||||
} else {
|
||||
f, err := os.Create(cmd.OutputPath + ".tmp")
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -73,16 +73,17 @@ func (cmd *RestoreTarCommand) Run(ctx context.Context) (err error) {
|
|||
}
|
||||
useStdin := cmd.Path == "-"
|
||||
|
||||
var f *os.File
|
||||
var f io.Reader
|
||||
// read from Stdin if path specified as -
|
||||
if useStdin {
|
||||
f = os.Stdin
|
||||
f = cmd.Stdin
|
||||
} else {
|
||||
f, err = os.Open(cmd.Path)
|
||||
file, err := os.Open(cmd.Path)
|
||||
if err != nil {
|
||||
return (err)
|
||||
}
|
||||
defer f.Close()
|
||||
defer file.Close()
|
||||
f = file
|
||||
}
|
||||
|
||||
// Parse TLS configuration for node-specific clients.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue