mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-25 21:29:14 +02:00
feat: Add default command for snapcraft (#749)
This commit is contained in:
parent
838c1cd50d
commit
a91c8fd185
@ -160,6 +160,13 @@ func create(ctx *context.Context, arch string, binaries []artifact.Artifact) err
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := metadata.Apps[metadata.Name]; !ok {
|
||||
metadata.Apps[metadata.Name] = AppMetadata{
|
||||
Command: binaries[0].Name,
|
||||
}
|
||||
}
|
||||
|
||||
out, err := yaml.Marshal(metadata)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -108,6 +108,8 @@ func TestRunPipeWithName(t *testing.T) {
|
||||
err = yaml.Unmarshal(yamlFile, &metadata)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, metadata.Name, "testsnapname")
|
||||
assert.Equal(t, metadata.Apps["mybin"].Command, "mybin")
|
||||
assert.Equal(t, metadata.Apps["testsnapname"].Command, "mybin")
|
||||
}
|
||||
|
||||
func TestRunPipeMetadata(t *testing.T) {
|
||||
|
@ -69,7 +69,7 @@ snapcraft:
|
||||
# you can declare extra details for those binaries. It is optional.
|
||||
apps:
|
||||
|
||||
# The name of the app must be the same name as the binary built.
|
||||
# The name of the app must be the same name as the binary built or the snapcraft name.
|
||||
drumroll:
|
||||
|
||||
# If your app requires extra permissions to work outside of its default
|
||||
|
Loading…
x
Reference in New Issue
Block a user