File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,10 @@ func preRun(cmd *cobra.Command, args []string) error {
144
144
}
145
145
}
146
146
147
+ if utils .IsInsideContainer () && ! utils .IsInsideToolboxContainer () {
148
+ return createErrorNonToolboxContainer ()
149
+ }
150
+
147
151
toolboxPath := os .Getenv ("TOOLBOX_PATH" )
148
152
149
153
if toolboxPath == "" {
Original file line number Diff line number Diff line change @@ -138,6 +138,16 @@ func createErrorInvalidRelease(hint string) error {
138
138
return errors .New (errMsg )
139
139
}
140
140
141
+ func createErrorNonToolboxContainer () error {
142
+ var builder strings.Builder
143
+ fmt .Fprintf (& builder , "this is not a Toolbox container.\n " )
144
+ fmt .Fprintf (& builder , "Toolbox is only meant to work with Toolbox containers.\n " )
145
+ fmt .Fprintf (& builder , "Run '%s --help' for usage." , executableBase )
146
+
147
+ errMsg := builder .String ()
148
+ return errors .New (errMsg )
149
+ }
150
+
141
151
func getUsageForCommonCommands () string {
142
152
var builder strings.Builder
143
153
fmt .Fprintf (& builder , "create Create a new toolbox container\n " )
You can’t perform that action at this time.
0 commit comments