Skip to content

Commit

Permalink
chore: update file paths for resources
Browse files Browse the repository at this point in the history
  • Loading branch information
kardolus committed Nov 6, 2024
1 parent 94892f4 commit 1aa6723
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ChatGPT CLI provides a powerful command-line interface for seamless interaction with ChatGPT models via OpenAI and
Azure, featuring streaming capabilities and extensive configuration options.

![a screenshot](resources/vhs.gif)
![a screenshot](cmd/chatgpt/resources/vhs.gif)

## Table of Contents

Expand Down
8 changes: 4 additions & 4 deletions cmd/chatgpt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"github.com/kardolus/chatgpt-cli/api/client"
"github.com/kardolus/chatgpt-cli/api/http"
utils2 "github.com/kardolus/chatgpt-cli/cmd/chatgpt/utils"
"github.com/kardolus/chatgpt-cli/cmd/chatgpt/utils"
"github.com/kardolus/chatgpt-cli/internal"
"github.com/spf13/pflag"
"gopkg.in/yaml.v3"
Expand Down Expand Up @@ -230,7 +230,7 @@ func run(cmd *cobra.Command, args []string) error {
}

if cmd.Flag("prompt").Changed {
prompt, err := utils2.FileToString(promptFile)
prompt, err := utils.FileToString(promptFile)
if err != nil {
return err
}
Expand Down Expand Up @@ -278,7 +278,7 @@ func run(cmd *cobra.Command, args []string) error {
defer rl.Close()

commandPrompt := func(counter, usage int) string {
return utils2.FormatPrompt(c.Config.CommandPrompt, counter, usage, time.Now())
return utils.FormatPrompt(c.Config.CommandPrompt, counter, usage, time.Now())
}

qNum, usage := 1, 0
Expand All @@ -291,7 +291,7 @@ func run(cmd *cobra.Command, args []string) error {
return nil
}

fmtOutputPrompt := utils2.FormatPrompt(c.Config.OutputPrompt, qNum, usage, time.Now())
fmtOutputPrompt := utils.FormatPrompt(c.Config.OutputPrompt, qNum, usage, time.Now())

if queryMode {
result, qUsage, err := c.Query(input)
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/kardolus/chatgpt-cli/config"
"github.com/kardolus/chatgpt-cli/history"
"github.com/kardolus/chatgpt-cli/internal"
utils2 "github.com/kardolus/chatgpt-cli/test"
"github.com/kardolus/chatgpt-cli/test"
"github.com/onsi/gomega/gexec"
"github.com/sclevine/spec"
"github.com/sclevine/spec/report"
Expand Down Expand Up @@ -580,7 +580,7 @@ func testIntegration(t *testing.T, when spec.G, it spec.S) {
historyFile := path.Join(filePath, "history", "default.json")
Expect(historyFile).NotTo(BeAnExistingFile())

bytes, err := utils2.FileToBytes("history.json")
bytes, err := test.FileToBytes("history.json")
Expect(err).NotTo(HaveOccurred())

Expect(os.WriteFile(legacyFile, bytes, 0644)).To(Succeed())
Expand Down
4 changes: 2 additions & 2 deletions test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func FileToBytes(fileName string) ([]byte, error) {
err error
)
if strings.Contains(thisFile, "vendor") {
urlPath, err = filepath.Abs(path.Join(thisFile, "../../../../../..", "resources", "testdata", fileName))
urlPath, err = filepath.Abs(path.Join(thisFile, "../../../../../..", "test", "data", fileName))
} else {
urlPath, err = filepath.Abs(path.Join(thisFile, "../..", "resources", "testdata", fileName))
urlPath, err = filepath.Abs(path.Join(thisFile, "../..", "test", "data", fileName))
}

if err != nil {
Expand Down

0 comments on commit 1aa6723

Please sign in to comment.