mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-09 13:36:56 +02:00
fix: Completer script link errors for snapcraft (#1679)
This commit is contained in:
parent
d798106316
commit
a69b525ddb
@ -270,7 +270,7 @@ func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries [
|
||||
log.WithField("src", config.Completer).
|
||||
WithField("dst", destCompleterPath).
|
||||
Debug("linking")
|
||||
if err := os.Link(config.Completer, destCompleterPath); err != nil {
|
||||
if err := os.Link(config.Completer, destCompleterPath); err != nil && !os.IsExist(err) {
|
||||
return errors.Wrap(err, "failed to link completer")
|
||||
}
|
||||
if err := os.Chmod(destCompleterPath, 0644); err != nil {
|
||||
|
@ -311,13 +311,14 @@ func TestCompleter(t *testing.T) {
|
||||
Completer: "testdata/mybin-completer.bash",
|
||||
},
|
||||
},
|
||||
Builds: []string{"foo"},
|
||||
Builds: []string{"foo", "bar"},
|
||||
},
|
||||
},
|
||||
})
|
||||
ctx.Git.CurrentTag = "v1.2.3"
|
||||
ctx.Version = "v1.2.3"
|
||||
addBinaries(t, ctx, "foo", dist, "mybin")
|
||||
addBinaries(t, ctx, "bar", dist, "mybin")
|
||||
require.NoError(t, Pipe{}.Run(ctx))
|
||||
yamlFile, err := ioutil.ReadFile(filepath.Join(dist, "foo_amd64", "prime", "meta", "snap.yaml"))
|
||||
require.NoError(t, err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user