Skip to content

Commit

Permalink
feat: optionally support LZO compression for snap (#65)
Browse files Browse the repository at this point in the history
* Optionally support LZO compression for snap

* Improve wording in hint
  • Loading branch information
om26er authored Aug 29, 2021
1 parent 4dbd42f commit 4e5877e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/package-format/snap/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type SnapOptions struct {

arch *string
output *string

compression *string
}

func ConfigureCommand(app *kingpin.Application) {
Expand All @@ -61,6 +63,8 @@ func ConfigureCommand(app *kingpin.Application) {
executableName: command.Flag("executable", "The executable file name to create command wrapper.").String(),
extraAppArgs: command.Flag("extraAppArgs", "The extra app launch arguments").String(),
excludedAppFiles: command.Flag("exclude", "The excluded app files.").Strings(),
compression: command.Flag("compression", "The compression type when building from template.").
Short('c').Default("xz").Enum("xz", "lzo"),

arch: command.Flag("arch", "The arch.").Default("amd64").String(),

Expand Down Expand Up @@ -285,7 +289,7 @@ func buildUsingTemplate(templateDir string, options SnapOptions) error {
return errors.WithStack(err)
}

args = append(args, *options.output, "-no-progress", "-quiet", "-noappend", "-comp", "xz", "-no-xattrs", "-no-fragments", "-all-root")
args = append(args, *options.output, "-no-progress", "-quiet", "-noappend", "-comp", *options.compression, "-no-xattrs", "-no-fragments", "-all-root")

_, err = util.Execute(exec.Command(mksquashfsPath, args...))
if err != nil {
Expand Down

0 comments on commit 4e5877e

Please sign in to comment.