From 1f2ddca32bd314e412aad9bb305f5f46add5db3c Mon Sep 17 00:00:00 2001 From: Simon Aquino Date: Sat, 16 Aug 2014 11:36:15 +0000 Subject: [PATCH] Add switchContext function to context.go --- cmd/context.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/context.go b/cmd/context.go index 58d322af..d316897f 100644 --- a/cmd/context.go +++ b/cmd/context.go @@ -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 {