Add option to control compression modes

This commit is contained in:
Kovid Goyal
2023-07-20 21:54:39 +05:30
parent 84c680266a
commit 346a651a48
4 changed files with 22 additions and 6 deletions

View File

@@ -84,7 +84,13 @@ func run_with_paths(cwd, home string, f func()) {
f()
}
func should_be_compressed(path string) bool {
func should_be_compressed(path, strategy string) bool {
if strategy == "always" {
return true
}
if strategy == "never" {
return false
}
ext := strings.ToLower(filepath.Ext(path))
if ext != "" {
switch ext[1:] {