From 5021cc3ba39eb11c885d36b7c62a7a4e2f50ae75 Mon Sep 17 00:00:00 2001 From: Hiroki Shirokura Date: Sat, 31 Oct 2020 16:00:09 +0900 Subject: [PATCH] Fix post init Signed-off-by: Hiroki Shirokura --- command_func.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/command_func.go b/command_func.go index 788f85a..f9a7a04 100644 --- a/command_func.go +++ b/command_func.go @@ -207,13 +207,6 @@ func CmdUp(c *cli.Context) error { return err } - if len(tnconfig.PostInit) != 0 { - for _, postInitCmds := range tnconfig.PostInit { - postExecInitCmds := shell.ExecCmd(postInitCmds.Cmds) - utils.PrintCmds(os.Stdout, postExecInitCmds, verbose) - } - } - for _, node := range tnconfig.Nodes { if node.Type == "docker" || node.Type == "" { delNsCmd := node.DelNsCmd() @@ -226,6 +219,13 @@ func CmdUp(c *cli.Context) error { } } + if len(tnconfig.PostInit) != 0 { + for _, postInitCmds := range tnconfig.PostInit { + postExecInitCmds := shell.ExecCmd(postInitCmds.Cmds) + utils.PrintCmds(os.Stdout, postExecInitCmds, verbose) + } + } + return nil }