mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
fix golangci-lint errors
This commit is contained in:
@@ -162,8 +162,7 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
forceOverwrite := context.Flags().Lookup("force-overwrite").Value.Get().(bool)
|
forceOverwrite := context.Flags().Lookup("force-overwrite").Value.Get().(bool)
|
||||||
if forceOverwrite {
|
if forceOverwrite {
|
||||||
context.Progress().ColoredPrintf("@rWARNING@|: force overwrite mode enabled, aptly might corrupt other published repositories sharing " +
|
context.Progress().ColoredPrintf("@rWARNING@|: force overwrite mode enabled, aptly might corrupt other published repositories sharing the same package pool.\n")
|
||||||
"the same package pool.\n")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.Progress(), forceOverwrite)
|
err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.Progress(), forceOverwrite)
|
||||||
|
|||||||
+6
-5
@@ -143,19 +143,20 @@ func (file *indexFile) Finalize(signer pgp.Signer) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if signer != nil {
|
if signer != nil {
|
||||||
|
gpgExt := ".gpg"
|
||||||
if file.detachedSign {
|
if file.detachedSign {
|
||||||
err = signer.DetachedSign(file.tempFilename, file.tempFilename+".gpg")
|
err = signer.DetachedSign(file.tempFilename, file.tempFilename+gpgExt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to detached sign file: %s", err)
|
return fmt.Errorf("unable to detached sign file: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if file.parent.suffix != "" {
|
if file.parent.suffix != "" {
|
||||||
file.parent.renameMap[filepath.Join(file.parent.basePath, file.relativePath+file.parent.suffix+".gpg")] =
|
file.parent.renameMap[filepath.Join(file.parent.basePath, file.relativePath+file.parent.suffix+gpgExt)] =
|
||||||
filepath.Join(file.parent.basePath, file.relativePath+".gpg")
|
filepath.Join(file.parent.basePath, file.relativePath+gpgExt)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = file.parent.publishedStorage.PutFile(filepath.Join(file.parent.basePath, file.relativePath+file.parent.suffix+".gpg"),
|
err = file.parent.publishedStorage.PutFile(filepath.Join(file.parent.basePath, file.relativePath+file.parent.suffix+gpgExt),
|
||||||
file.tempFilename+".gpg")
|
file.tempFilename+gpgExt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to publish file: %s", err)
|
return fmt.Errorf("unable to publish file: %s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user