diff --git a/pkg/cmd/create_formula_test.go b/pkg/cmd/create_formula_test.go index 2436e0f83..b994ae3e1 100644 --- a/pkg/cmd/create_formula_test.go +++ b/pkg/cmd/create_formula_test.go @@ -408,7 +408,7 @@ func createFormulaCmdDeps(ritchieHomeDir string, dirManager stream.DirManager, f createBuilder := formula.NewCreateBuilder(createManager, formBuildLocal) buildLocal := builder.NewBuildLocal(ritchieHomeDir, dirManager, repoAdder) wspaceManager := workspace.New(ritchieHomeDir, os.TempDir(), dirManager, buildLocal) - tutorialFinder := rtutorial.NewFinder(ritchieHomeDir, fileManager) + tutorialFinder := rtutorial.NewFinder(ritchieHomeDir) return createFormulaCmd{ formula: createBuilder, diff --git a/pkg/cmd/tutorial.go b/pkg/cmd/tutorial.go index 6f468a648..260b1484a 100644 --- a/pkg/cmd/tutorial.go +++ b/pkg/cmd/tutorial.go @@ -17,16 +17,18 @@ package cmd import ( + "errors" "fmt" + "reflect" + + "github.com/spf13/cobra" "github.com/ZupIT/ritchie-cli/pkg/prompt" "github.com/ZupIT/ritchie-cli/pkg/rtutorial" "github.com/ZupIT/ritchie-cli/pkg/stdin" - "github.com/spf13/cobra" ) type tutorialCmd struct { - homePath string prompt.InputList tutorial rtutorial.FindSetter } @@ -34,69 +36,104 @@ type tutorialCmd struct { const ( tutorialStatusEnabled = "enabled" tutorialStatusDisabled = "disabled" + enabledFlagName = "enabled" ) +var tutorialFlags = flags{ + { + name: enabledFlagName, + kind: reflect.Bool, + defValue: false, + description: "enable the tutorial", + }, +} + // NewTutorialCmd creates tutorial command. -func NewTutorialCmd(homePath string, il prompt.InputList, fs rtutorial.FindSetter) *cobra.Command { - o := tutorialCmd{homePath, il, fs} +func NewTutorialCmd(il prompt.InputList, tt rtutorial.FindSetter) *cobra.Command { + o := tutorialCmd{il, tt} cmd := &cobra.Command{ Use: "tutorial", Short: "Enable or disable the tutorial", Long: "Enable or disable the tutorial", - RunE: RunFuncE(o.runStdin(), o.runPrompt()), + RunE: RunFuncE(o.runStdin(), o.runFormula()), ValidArgs: []string{""}, Args: cobra.OnlyValidArgs, } - cmd.LocalFlags() + addReservedFlags(cmd.Flags(), tutorialFlags) return cmd } -func (o tutorialCmd) runStdin() CommandRunnerFunc { +func (t *tutorialCmd) runFormula() CommandRunnerFunc { return func(cmd *cobra.Command, args []string) error { - obj := struct { - Tutorial string `json:"tutorial"` - }{} - - if err := stdin.ReadJson(cmd.InOrStdin(), &obj); err != nil { + enabled, err := t.resolveInput(cmd) + if err != nil { return err } - if _, err := o.tutorial.Set(obj.Tutorial); err != nil { + _, err = t.tutorial.Set(enabled) + if err != nil { return err } + prompt.Success("Tutorial " + enabled + "!") + return nil + } +} - prompt.Success("Tutorial " + obj.Tutorial + "!") +func (t *tutorialCmd) resolveInput(cmd *cobra.Command) (string, error) { + if IsFlagInput(cmd) { + return t.resolveFlags(cmd) + } + return t.resolvePrompt() +} - return nil +func (t *tutorialCmd) resolveFlags(cmd *cobra.Command) (string, error) { + enabled, err := cmd.Flags().GetBool(enabledFlagName) + if err != nil { + return "", errors.New(missingFlagText(enabledFlagName)) + } else if enabled { + return tutorialStatusEnabled, nil } + return tutorialStatusDisabled, nil } -func (o tutorialCmd) runPrompt() CommandRunnerFunc { - return func(cmd *cobra.Command, args []string) error { - msg := "Status tutorial?" - var statusTypes = []string{tutorialStatusEnabled, tutorialStatusDisabled} +func (t *tutorialCmd) resolvePrompt() (string, error) { + msg := "Status tutorial?" + var statusTypes = []string{tutorialStatusEnabled, tutorialStatusDisabled} - tutorialHolder, err := o.tutorial.Find() - if err != nil { - return err - } + tutorialHolder, err := t.tutorial.Find() + if err != nil { + return "", err + } - tutorialStatusCurrent := tutorialHolder.Current - fmt.Println("Current tutorial status: ", tutorialStatusCurrent) + tutorialStatusCurrent := tutorialHolder.Current + fmt.Println("Current tutorial status: ", tutorialStatusCurrent) - response, err := o.List(msg, statusTypes) - if err != nil { + response, err := t.List(msg, statusTypes) + if err != nil { + return "", err + } + return response, nil +} + +func (t *tutorialCmd) runStdin() CommandRunnerFunc { + return func(cmd *cobra.Command, args []string) error { + obj := struct { + Tutorial string `json:"tutorial"` + }{} + + if err := stdin.ReadJson(cmd.InOrStdin(), &obj); err != nil { return err } - _, err = o.tutorial.Set(response) - if err != nil { + if _, err := t.tutorial.Set(obj.Tutorial); err != nil { return err } - prompt.Success("Tutorial " + response + "!") + + prompt.Success("Tutorial " + obj.Tutorial + "!") + return nil } } diff --git a/pkg/cmd/tutorial_test.go b/pkg/cmd/tutorial_test.go index 24c292dba..673f6f478 100644 --- a/pkg/cmd/tutorial_test.go +++ b/pkg/cmd/tutorial_test.go @@ -18,170 +18,100 @@ package cmd import ( "errors" + "os" + "path/filepath" "strings" "testing" - "github.com/ZupIT/ritchie-cli/pkg/prompt" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/ZupIT/ritchie-cli/internal/mocks" "github.com/ZupIT/ritchie-cli/pkg/rtutorial" ) -func TestNewTutorialCmd(t *testing.T) { - cmd := NewTutorialCmd("path/any", inputListMock{}, TutorialFindSetterMock{}) - cmd.PersistentFlags().Bool("stdin", false, "input by stdin") - - if cmd == nil { - t.Errorf("NewTutorialCmd got %v", cmd) - } - - if err := cmd.Execute(); err != nil { - t.Errorf("%s = %v, want %v", cmd.Use, err, nil) - } -} - -func TestNewTutorialStdin(t *testing.T) { - cmd := NewTutorialCmd("path/any", inputListMock{}, TutorialFindSetterMock{}) - cmd.PersistentFlags().Bool("stdin", true, "input by stdin") - - input := "{\"tutorial\": \"enabled\"}\n" - newReader := strings.NewReader(input) - cmd.SetIn(newReader) - - if cmd == nil { - t.Errorf("NewTutorialCmd got %v", cmd) - } +func TestTutorialCmd(t *testing.T) { + ritPath := filepath.Join(os.TempDir(), "tutorial") + _ = os.Mkdir(ritPath, os.ModePerm) + defer os.RemoveAll(ritPath) - if err := cmd.Execute(); err != nil { - t.Errorf("%s = %v, want %v", cmd.Use, err, nil) - } -} - -func TestTutorialRunAnyEntry(t *testing.T) { - var tutorialHolderEnabled, tutorialHolderDisabled rtutorial.TutorialHolder - type fields struct { - prompt.InputList - tutorial rtutorial.FindSetter - } - - tutorialHolderEnabled.Current = "enabled" - tutorialHolderDisabled.Current = "disabled" + tutorialFinder := rtutorial.NewFinder(ritPath) + tutorialSetter := rtutorial.NewSetter(ritPath) + tutorialFindSetter := rtutorial.NewFindSetter(tutorialFinder, tutorialSetter) tests := []struct { - name string - fields fields - wantErr bool - inputStdin string + name string + ritHome string + args []string + listErr error + err error }{ { - name: "Run With Success when set tutorial enabled", - fields: fields{ - InputList: inputListCustomMock{ - list: func(name string, items []string) (string, error) { - return "enabled", nil - }, - }, - tutorial: TutorialFindSetterMock{}, - }, - wantErr: false, - inputStdin: "{\"tutorial\": \"enabled\"}\n", + name: "success prompt", + ritHome: ritPath, + args: []string{}, + }, + { + name: "fail list", + ritHome: ritPath, + args: []string{}, + listErr: errors.New("list error"), + err: errors.New("list error"), }, { - name: "Run With Success when set tutorial disabled", - fields: fields{ - InputList: inputListCustomMock{ - list: func(name string, items []string) (string, error) { - return "disabled", nil - }, - }, - tutorial: TutorialFindSetterMock{}, - }, - wantErr: false, - inputStdin: "{\"tutorial\": \"disabled\"}\n", + name: "success flags", + ritHome: ritPath, + args: []string{"--enabled=true"}, }, { - name: "Return error when set return error", - fields: fields{ - InputList: inputListCustomMock{ - list: func(name string, items []string) (string, error) { - return "enabled", nil - }, - }, - tutorial: TutorialFindSetterCustomMock{ - set: func(tutorial string) (rtutorial.TutorialHolder, error) { - return tutorialHolderEnabled, errors.New("some error") - }, - find: func() (rtutorial.TutorialHolder, error) { - return tutorialHolderEnabled, nil - }, - }, - }, - wantErr: true, - inputStdin: "{\"tutorial\": \"enabled\"}\n", + name: "fail empty flag", + ritHome: ritPath, + args: []string{"--enabled="}, + err: errors.New("invalid argument \"\" for \"--enabled\" flag: strconv.ParseBool: parsing \"\": invalid syntax"), + }, + { + name: "fail set", + ritHome: ritPath, + args: []string{}, }, } - for _, tt := range tests { - cmdPrompt := NewTutorialCmd("path/any", tt.fields.InputList, tt.fields.tutorial) - cmdStdin := NewTutorialCmd("path/any", tt.fields.InputList, tt.fields.tutorial) - - cmdPrompt.PersistentFlags().Bool("stdin", false, "input by stdin") - cmdStdin.PersistentFlags().Bool("stdin", true, "input by stdin") - - newReader := strings.NewReader(tt.inputStdin) - cmdStdin.SetIn(newReader) - if err := cmdPrompt.Execute(); (err != nil) != tt.wantErr { - t.Errorf("cmd_runPrompt() error = %v, wantErr %v", err, tt.wantErr) - } - if err := cmdStdin.Execute(); (err != nil) != tt.wantErr { - t.Errorf("cmd_runStdin() error = %v, wantErr %v", err, tt.wantErr) - } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + inputList := &mocks.InputListMock{} + inputList.On("List", mock.Anything, mock.Anything, mock.Anything).Return(tutorialStatusEnabled, tt.listErr) + cmd := NewTutorialCmd(inputList, tutorialFindSetter) + + cmd.PersistentFlags().Bool("stdin", false, "input by stdin") + cmd.SetArgs(tt.args) + + err := cmd.Execute() + + if err != nil { + assert.Equal(t, tt.err, err) + } else { + assert.Nil(t, tt.err) + assert.FileExists(t, filepath.Join(tt.ritHome, rtutorial.TutorialFile)) + } + }) } } -func TestTutorialRunOnlyPrompt(t *testing.T) { - type fields struct { - prompt.InputList - tutorial rtutorial.FindSetter - } +func TestNewTutorialStdin(t *testing.T) { + cmd := NewTutorialCmd(inputListMock{}, TutorialFindSetterMock{}) + cmd.PersistentFlags().Bool("stdin", true, "input by stdin") + cmd.SetArgs([]string{}) - var tutorialHolderEnabled rtutorial.TutorialHolder - tutorialHolderEnabled.Current = "enabled" + input := "{\"tutorial\": \"enabled\"}\n" + newReader := strings.NewReader(input) + cmd.SetIn(newReader) - tests := []struct { - name string - fields fields - }{ - { - name: "Return error when find return error", - fields: fields{ - InputList: inputListCustomMock{ - list: func(name string, items []string) (string, error) { - return "enabled", nil - }, - }, - tutorial: TutorialFindSetterCustomMock{ - find: func() (rtutorial.TutorialHolder, error) { - return tutorialHolderEnabled, errors.New("some error") - }, - }, - }, - }, - { - name: "Return error when list return error", - fields: fields{ - InputList: inputListErrorMock{}, - tutorial: TutorialFindSetterMock{}, - }, - }, + if cmd == nil { + t.Errorf("NewTutorialCmd got %v", cmd) } - for _, tt := range tests { - wantErr := true - - cmd := NewTutorialCmd("path/any", tt.fields.InputList, tt.fields.tutorial) - cmd.PersistentFlags().Bool("stdin", false, "input by stdin") - if err := cmd.Execute(); (err != nil) != wantErr { - t.Errorf("cmd_runPrompt() error = %v, wantErr %v", err, wantErr) - } + if err := cmd.Execute(); err != nil { + t.Errorf("%s = %v, want %v", cmd.Use, err, nil) } } @@ -189,7 +119,7 @@ func TestTutorialRunOnlyStdin(t *testing.T) { t.Run("Error when readJson returns err", func(t *testing.T) { wantErr := true - cmdStdin := NewTutorialCmd("path/any", inputListMock{}, TutorialFindSetterMock{}) + cmdStdin := NewTutorialCmd(inputListMock{}, TutorialFindSetterMock{}) cmdStdin.PersistentFlags().Bool("stdin", true, "input by stdin") newReader := strings.NewReader("{\"tutorial\": 1}\n") diff --git a/pkg/commands/builder.go b/pkg/commands/builder.go index f8dfc4897..0808a1277 100644 --- a/pkg/commands/builder.go +++ b/pkg/commands/builder.go @@ -132,9 +132,9 @@ func Build() *cobra.Command { treeChecker := tree.NewChecker(treeManager) autocompleteGen := autocomplete.NewGenerator(treeManager) credResolver := credential.NewResolver(credFinder, credSetter, inputPassword) - tutorialFinder := rtutorial.NewFinder(ritchieHomeDir, fileManager) - tutorialSetter := rtutorial.NewSetter(ritchieHomeDir, fileManager) - tutorialFindSetter := rtutorial.NewFindSetter(ritchieHomeDir, tutorialFinder, tutorialSetter) + tutorialFinder := rtutorial.NewFinder(ritchieHomeDir) + tutorialSetter := rtutorial.NewSetter(ritchieHomeDir) + tutorialFindSetter := rtutorial.NewFindSetter(tutorialFinder, tutorialSetter) formBuildMake := builder.NewBuildMake() formBuildSh := builder.NewBuildShell() @@ -204,7 +204,7 @@ func Build() *cobra.Command { githubRepo, ) metricsCmd := cmd.NewMetricsCmd(fileManager, inputList) - tutorialCmd := cmd.NewTutorialCmd(ritchieHomeDir, inputList, tutorialFindSetter) + tutorialCmd := cmd.NewTutorialCmd(inputList, tutorialFindSetter) // level 2 setCredentialCmd := cmd.NewSetCredentialCmd( diff --git a/pkg/rtutorial/find_setter.go b/pkg/rtutorial/find_setter.go index 56af8e409..7919637ec 100644 --- a/pkg/rtutorial/find_setter.go +++ b/pkg/rtutorial/find_setter.go @@ -16,14 +16,11 @@ package rtutorial -import "fmt" - type FindSetterManager struct { - tutorialFile string Finder Setter } -func NewFindSetter(homePath string, f Finder, s Setter) FindSetterManager { - return FindSetterManager{fmt.Sprintf(TutorialPath, homePath), f, s} +func NewFindSetter(f Finder, s Setter) FindSetterManager { + return FindSetterManager{f, s} } diff --git a/pkg/rtutorial/finder.go b/pkg/rtutorial/finder.go index 9e6106eb5..ba03e7e80 100644 --- a/pkg/rtutorial/finder.go +++ b/pkg/rtutorial/finder.go @@ -18,33 +18,29 @@ package rtutorial import ( "encoding/json" - "fmt" - - "github.com/ZupIT/ritchie-cli/pkg/stream" + "io/ioutil" + "os" + "path/filepath" ) type FindManager struct { tutorialFile string - homePath string - fr stream.FileReadExister } -func NewFinder(homePath string, fr stream.FileReadExister) FindManager { +func NewFinder(homePath string) FindManager { return FindManager{ - tutorialFile: fmt.Sprintf(TutorialPath, homePath), - homePath: homePath, - fr: fr, + tutorialFile: filepath.Join(homePath, TutorialFile), } } func (f FindManager) Find() (TutorialHolder, error) { tutorialHolder := TutorialHolder{Current: DefaultTutorial} - if !f.fr.Exists(f.tutorialFile) { + if _, err := os.Stat(f.tutorialFile); os.IsNotExist(err) { return tutorialHolder, nil } - file, err := f.fr.Read(f.tutorialFile) + file, err := ioutil.ReadFile(f.tutorialFile) if err != nil { return tutorialHolder, err } diff --git a/pkg/rtutorial/finder_test.go b/pkg/rtutorial/finder_test.go index 9ac5eb150..8f2c8f671 100644 --- a/pkg/rtutorial/finder_test.go +++ b/pkg/rtutorial/finder_test.go @@ -17,92 +17,57 @@ package rtutorial import ( - "errors" - "fmt" + "io/ioutil" "os" - "reflect" + "path/filepath" "testing" - "github.com/ZupIT/ritchie-cli/pkg/stream" - sMocks "github.com/ZupIT/ritchie-cli/pkg/stream/mocks" + "github.com/stretchr/testify/assert" ) -var errReadingFile = errors.New("error reading file") - func TestFind(t *testing.T) { - type out struct { - err error - want TutorialHolder - wantError bool - } + ritHome := filepath.Join(os.TempDir(), "tutorial") + _ = os.Mkdir(ritHome, os.ModePerm) + defer os.RemoveAll(ritHome) tests := []struct { - name string - in stream.FileReadExister - out *out + name string + holderState string + fileContent string + err string }{ { - name: "With no tutorial file", - in: sMocks.FileReadExisterCustomMock{ - ExistsMock: func(path string) bool { - return false - }, - }, - out: &out{ - want: TutorialHolder{Current: "enabled"}, - err: nil, - wantError: false, - }, + name: "With no tutorial file", + holderState: "enabled", }, { - name: "With existing tutorial file", - in: sMocks.FileReadExisterCustomMock{ - ReadMock: func(path string) ([]byte, error) { - return []byte("{\"tutorial\":\"disabled\"}"), nil - }, - ExistsMock: func(path string) bool { - return true - }, - }, - out: &out{ - want: TutorialHolder{Current: "disabled"}, - err: nil, - wantError: false, - }, + name: "With existing tutorial file", + holderState: "disabled", + fileContent: `{"tutorial": "disabled"}`, }, { - name: "Error reading the tutorial file", - in: sMocks.FileReadExisterCustomMock{ - ReadMock: func(path string) ([]byte, error) { - return []byte(""), errReadingFile - }, - ExistsMock: func(path string) bool { - return true - }, - }, - out: &out{ - want: TutorialHolder{Current: "enabled"}, - err: errReadingFile, - wantError: true, - }, + name: "Error reading the tutorial file", + fileContent: "error", + err: "invalid character 'e' looking for beginning of value", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tmp := os.TempDir() - tmpTutorial := fmt.Sprintf(TutorialPath, tmp) - defer os.RemoveAll(tmpTutorial) + if tt.fileContent != "" { + err := ioutil.WriteFile(filepath.Join(ritHome, TutorialFile), []byte(tt.fileContent), os.ModePerm) + assert.NoError(t, err) + } - finder := NewFinder(tmp, tt.in) + finder := NewFinder(ritHome) - out := tt.out got, err := finder.Find() - if err != nil && !tt.out.wantError { - t.Errorf("%s - Execution error - got %v, want %v", tt.name, err, out.err) - } - if !reflect.DeepEqual(out.want, got) { - t.Errorf("%s - Error in the expected response - got %v, want %v", tt.name, got, out.want) + + if err != nil { + assert.EqualError(t, err, tt.err) + } else { + assert.Empty(t, tt.err) + assert.Equal(t, tt.holderState, got.Current) } }) } diff --git a/pkg/rtutorial/setter.go b/pkg/rtutorial/setter.go index 8267ccf7f..9945b5fe9 100644 --- a/pkg/rtutorial/setter.go +++ b/pkg/rtutorial/setter.go @@ -18,36 +18,33 @@ package rtutorial import ( "encoding/json" - "fmt" - - "github.com/ZupIT/ritchie-cli/pkg/stream" + "io/ioutil" + "os" + "path/filepath" ) type SetterManager struct { tutorialFile string - fw stream.FileWriter } -func NewSetter(homePath string, fw stream.FileWriter) Setter { +func NewSetter(homePath string) Setter { return SetterManager{ - tutorialFile: fmt.Sprintf(TutorialPath, homePath), - fw: fw, + tutorialFile: filepath.Join(homePath, TutorialFile), } } func (s SetterManager) Set(tutorial string) (TutorialHolder, error) { tutorialHolder := TutorialHolder{Current: DefaultTutorial} - tutorialHolderDefault := TutorialHolder{Current: DefaultTutorial} tutorialHolder.Current = tutorial b, err := json.Marshal(&tutorialHolder) if err != nil { - return tutorialHolderDefault, err + return tutorialHolder, err } - if err := s.fw.Write(s.tutorialFile, b); err != nil { - return tutorialHolderDefault, err + if err := ioutil.WriteFile(s.tutorialFile, b, os.ModePerm); err != nil { + return tutorialHolder, err } return tutorialHolder, nil diff --git a/pkg/rtutorial/setter_test.go b/pkg/rtutorial/setter_test.go index 352bd9df5..44abd0424 100644 --- a/pkg/rtutorial/setter_test.go +++ b/pkg/rtutorial/setter_test.go @@ -17,92 +17,51 @@ package rtutorial import ( - "errors" - "fmt" + "encoding/json" + "io/ioutil" "os" - "reflect" + "path/filepath" "testing" - "github.com/ZupIT/ritchie-cli/pkg/stream" - sMocks "github.com/ZupIT/ritchie-cli/pkg/stream/mocks" + "github.com/stretchr/testify/assert" ) func TestSet(t *testing.T) { - type out struct { - want TutorialHolder - err error - waitError bool - } - err := errors.New("some error") tests := []struct { - name string - in string - out *out - FileWriter stream.FileWriter + name string + in string }{ { name: "Set enabled tutorial", in: "enabled", - out: &out{ - want: TutorialHolder{Current: "enabled"}, - err: nil, - waitError: false, - }, - FileWriter: sMocks.FileWriterCustomMock{ - WriteMock: func(path string, content []byte) error { - return nil - }, - }, }, { name: "Set disabled tutorial", in: "disabled", - out: &out{ - want: TutorialHolder{Current: "disabled"}, - err: nil, - waitError: false, - }, - FileWriter: sMocks.FileWriterCustomMock{ - WriteMock: func(path string, content []byte) error { - return nil - }, - }, - }, - { - name: "Error writing the tutorial file", - in: DefaultTutorial, - out: &out{ - want: TutorialHolder{Current: DefaultTutorial}, - err: err, - waitError: true, - }, - FileWriter: sMocks.FileWriterCustomMock{ - WriteMock: func(path string, content []byte) error { - return err - }, - }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tmp := os.TempDir() - tmpTutorial := fmt.Sprintf(TutorialPath, tmp) - defer os.RemoveAll(tmpTutorial) + tmpTutorial := filepath.Join(tmp, TutorialFile) + defer os.Remove(tmpTutorial) + + setter := NewSetter(tmp) + got, err := setter.Set(tt.in) + assert.NoError(t, err) - setter := NewSetter(tmp, tt.FileWriter) + expected := TutorialHolder{Current: tt.in} + assert.Equal(t, expected, got) - in := tt.in - out := tt.out + file, err := ioutil.ReadFile(tmpTutorial) + assert.NoError(t, err) - got, err := setter.Set(in) - if err != nil && !tt.out.waitError { - t.Errorf("Set(%s) - Execution error - got %v, want %v", tt.name, err, out.err) - } - if !reflect.DeepEqual(out.want, got) { - t.Errorf("Set(%s) - Error in the expected response - got %v, want %v", tt.name, got, out.want) - } + var holder = TutorialHolder{} + err = json.Unmarshal(file, &holder) + assert.NoError(t, err) + assert.Equal(t, expected, holder) }) } diff --git a/pkg/rtutorial/tutorial.go b/pkg/rtutorial/tutorial.go index 6307b6223..e58893be1 100644 --- a/pkg/rtutorial/tutorial.go +++ b/pkg/rtutorial/tutorial.go @@ -16,7 +16,7 @@ package rtutorial -const TutorialPath = "%s/tutorial.json" +const TutorialFile = "tutorial.json" const DefaultTutorial = "enabled"