Skip to content

Commit

Permalink
✨ Add Pipe shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 6, 2022
1 parent e8dc2a2 commit f085edf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ func run(cmd *cobra.Command, args []string) (err error) {
func buildCommand(db config.Databaser, conf config.Dump) *command.Builder {
cmd := db.DumpCommand(conf)
if conf.Format != sqlformat.Custom {
cmd.Push(command.Raw("|"), "gzip", "--force")
cmd.Push(command.Pipe, "gzip", "--force")
}
// base64 is required since TTYs use CRLF
cmd.Push(command.Raw("|"), "base64", "-w0")
cmd.Push(command.Pipe, "base64", "-w0")
return cmd
}
2 changes: 1 addition & 1 deletion cmd/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func run(cmd *cobra.Command, args []string) (err error) {

func buildCommand(conf config.Restore, inputFormat sqlformat.Format) *command.Builder {
return conf.Grammar.RestoreCommand(conf, inputFormat).
Unshift("gunzip", "--force", command.Raw("|"))
Unshift("gunzip", "--force", command.Pipe)
}

func gzipCopy(w io.Writer, r io.Reader) (err error) {
Expand Down
2 changes: 2 additions & 0 deletions internal/command/raw.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package command

type Raw string

const Pipe = Raw("|")

0 comments on commit f085edf

Please sign in to comment.