mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Added panicked attribute to context.go
This attribute is set to false during initalisation, and it's set to true when error arises.
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
type AptlyContext struct {
|
||||
flags *flag.FlagSet
|
||||
configLoaded bool
|
||||
panicked bool
|
||||
|
||||
progress aptly.Progress
|
||||
downloader aptly.Downloader
|
||||
@@ -58,6 +59,7 @@ func Fatal(err error) {
|
||||
if err == commander.ErrFlagError || err == commander.ErrCommandError {
|
||||
returnCode = 2
|
||||
}
|
||||
context.panicked = true
|
||||
panic(&FatalError{ReturnCode: returnCode, Message: err.Error()})
|
||||
}
|
||||
|
||||
@@ -273,6 +275,7 @@ func InitContext(flags *flag.FlagSet) error {
|
||||
|
||||
context = &AptlyContext{
|
||||
flags: flags,
|
||||
panicked: false,
|
||||
dependencyOptions: -1,
|
||||
publishedStorages: map[string]aptly.PublishedStorage{},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user