Skip to content

Commit

Permalink
adapt gzip options to Alpine Linux
Browse files Browse the repository at this point in the history
`gzip` command on Alpine does not have longhand options.
To use `-9` and `-f` instead of `--best` and `--force` enhance compatibility.
  • Loading branch information
cu39 committed Nov 13, 2018
1 parent 1be5f55 commit 93a0caa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/wordmove/deployer/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,16 @@ def mysql_import_command(dump_path, options)

def compress_command(path)
command = ["gzip"]
command << "--best"
command << "--force"
command << "-9"
command << "-f"
command << "\"#{path}\""
command.join(" ")
end

def uncompress_command(path)
command = ["gzip"]
command << "-d"
command << "--force"
command << "-f"
command << "\"#{path}\""
command.join(" ")
end
Expand Down
4 changes: 2 additions & 2 deletions spec/deployer/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"dummy file.sql"
)

expect(command).to eq("gzip --best --force \"dummy file.sql\"")
expect(command).to eq("gzip -9 -f \"dummy file.sql\"")
end
end

Expand All @@ -138,7 +138,7 @@
"dummy file.sql"
)

expect(command).to eq("gzip -d --force \"dummy file.sql\"")
expect(command).to eq("gzip -d -f \"dummy file.sql\"")
end
end
end

0 comments on commit 93a0caa

Please sign in to comment.