mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-21 12:57:40 +00:00
Fixed a bug with the context switching
The context switching wasn't really happening. Now the issue is fixed.
This commit is contained in:
+3
-1
@@ -42,6 +42,7 @@ type AptlyContext struct {
|
|||||||
|
|
||||||
var context *AptlyContext
|
var context *AptlyContext
|
||||||
var savedContext *AptlyContext
|
var savedContext *AptlyContext
|
||||||
|
var tempContext *AptlyContext
|
||||||
|
|
||||||
// Check interface
|
// Check interface
|
||||||
var _ aptly.PublishedStorageProvider = &AptlyContext{}
|
var _ aptly.PublishedStorageProvider = &AptlyContext{}
|
||||||
@@ -67,8 +68,9 @@ func Fatal(err error) {
|
|||||||
|
|
||||||
func switchContext() {
|
func switchContext() {
|
||||||
|
|
||||||
savedContext = context
|
tempContext = context
|
||||||
context = savedContext
|
context = savedContext
|
||||||
|
savedContext = tempContext
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -84,7 +84,7 @@ func aptlyTaskRun(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
for i, command := range cmd_list {
|
for i, command := range cmd_list {
|
||||||
|
|
||||||
if !context.panicked {
|
if context == nil || !context.panicked {
|
||||||
color.Printf("@g%d) [Running]: %s@!\n", (i + 1), strings.Join(command, " "))
|
color.Printf("@g%d) [Running]: %s@!\n", (i + 1), strings.Join(command, " "))
|
||||||
color.Println("\n@yBegin command output: ----------------------------\n@!")
|
color.Println("\n@yBegin command output: ----------------------------\n@!")
|
||||||
Run(command, false)
|
Run(command, false)
|
||||||
@@ -95,7 +95,6 @@ func aptlyTaskRun(cmd *commander.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if context.panicked {
|
if context.panicked {
|
||||||
err = fmt.Errorf("At least one command has reported an error\n")
|
err = fmt.Errorf("At least one command has reported an error\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user