(cmd *cobra.Command, args []string)
| 43 | } |
| 44 | |
| 45 | func rootRunImpl(cmd *cobra.Command, args []string) error { |
| 46 | if len(args) != 0 { |
| 47 | panic("unexpected argument: commands known or unknown shouldn't reach here") |
| 48 | } |
| 49 | |
| 50 | if utils.IsInsideContainer() { |
| 51 | if !utils.IsInsideToolboxContainer() { |
| 52 | return errors.New("this is not a Toolbx container") |
| 53 | } |
| 54 | |
| 55 | exitCode, err := utils.ForwardToHost() |
| 56 | return &exitError{exitCode, err} |
| 57 | } |
| 58 | |
| 59 | container, image, release, err := resolveContainerAndImageNames("", "", "", "", "") |
| 60 | if err != nil { |
| 61 | return err |
| 62 | } |
| 63 | |
| 64 | userShell := os.Getenv("SHELL") |
| 65 | if userShell == "" { |
| 66 | return errors.New("failed to get the current user's default shell") |
| 67 | } |
| 68 | |
| 69 | command := []string{userShell, "-l"} |
| 70 | |
| 71 | if err := runCommand(container, true, image, release, 0, command, true, true, false); err != nil { |
| 72 | return err |
| 73 | } |
| 74 | |
| 75 | return nil |
| 76 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…