diff --git a/pkg/odo/cli/deploy/deploy.go b/pkg/odo/cli/deploy/deploy.go index 89753c9d61b..8ad6d84872f 100644 --- a/pkg/odo/cli/deploy/deploy.go +++ b/pkg/odo/cli/deploy/deploy.go @@ -65,7 +65,7 @@ func (o *DeployOptions) Complete(cmdline cmdline.Cmdline, args []string) (err er return err } if isEmptyDir { - return errors.New("this command cannot run in an empty directory, you need to run it in a directory containing source code") + return errors.New("This command cannot run in an empty directory. Run the command in a directory containing source code.\nIf you wish to initialize a new project with sample source code, use 'odo init'.") } initFlags := o.clientset.InitClient.GetFlags(cmdline.GetFlags()) diff --git a/pkg/odo/cli/dev/dev.go b/pkg/odo/cli/dev/dev.go index 5de1427cff4..5d2abc94b11 100644 --- a/pkg/odo/cli/dev/dev.go +++ b/pkg/odo/cli/dev/dev.go @@ -89,7 +89,7 @@ func (o *DevOptions) Complete(cmdline cmdline.Cmdline, args []string) error { return err } if isEmptyDir { - return errors.New("this command cannot run in an empty directory, you need to run it in a directory containing source code") + return errors.New("This command cannot run in an empty directory. Run the command in a directory containing source code.\nIf you wish to initialize a new project with sample source code, use 'odo init'.") } initFlags := o.clientset.InitClient.GetFlags(cmdline.GetFlags()) err = o.clientset.InitClient.InitDevfile(initFlags, o.contextDir, diff --git a/tests/integration/devfile/cmd_dev_test.go b/tests/integration/devfile/cmd_dev_test.go index 9a640564a16..d3083d311f1 100644 --- a/tests/integration/devfile/cmd_dev_test.go +++ b/tests/integration/devfile/cmd_dev_test.go @@ -45,7 +45,7 @@ var _ = Describe("odo dev command tests", func() { It("should error", func() { output := helper.Cmd("odo", "dev").ShouldFail().Err() - Expect(output).To(ContainSubstring("this command cannot run in an empty directory")) + Expect(output).To(ContainSubstring("This command cannot run in an empty directory")) }) }) diff --git a/tests/integration/devfile/cmd_devfile_deploy_test.go b/tests/integration/devfile/cmd_devfile_deploy_test.go index d2fef1e61a9..9d5ac9ae0e4 100644 --- a/tests/integration/devfile/cmd_devfile_deploy_test.go +++ b/tests/integration/devfile/cmd_devfile_deploy_test.go @@ -35,7 +35,7 @@ var _ = Describe("odo devfile deploy command tests", func() { It("should error", func() { output := helper.Cmd("odo", "deploy").ShouldFail().Err() - Expect(output).To(ContainSubstring("this command cannot run in an empty directory")) + Expect(output).To(ContainSubstring("This command cannot run in an empty directory")) }) })