mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Add switchContext function to context.go
This commit is contained in:
@@ -40,6 +40,7 @@ type AptlyContext struct {
|
||||
}
|
||||
|
||||
var context *AptlyContext
|
||||
var savedContext *AptlyContext
|
||||
|
||||
// Check interface
|
||||
var _ aptly.PublishedStorageProvider = &AptlyContext{}
|
||||
@@ -60,6 +61,13 @@ func Fatal(err error) {
|
||||
panic(&FatalError{ReturnCode: returnCode, Message: err.Error()})
|
||||
}
|
||||
|
||||
func switchContext() {
|
||||
|
||||
savedContext = context
|
||||
context = savedContext
|
||||
|
||||
}
|
||||
|
||||
// Config loads and returns current configuration
|
||||
func (context *AptlyContext) Config() *utils.ConfigStructure {
|
||||
if !context.configLoaded {
|
||||
|
||||
Reference in New Issue
Block a user