Skip to content

Commit

Permalink
minor bugs resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshyajain-0291 committed Sep 29, 2024
1 parent f66dc11 commit c9bb5a0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 18 deletions.
34 changes: 17 additions & 17 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,20 @@ archives:
format: zip
id: windows-archive

scoops:
- name: gencli
url_template: "https://github.com/lakshyajain-0291/gencli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
commit_author:
name: lakshyajain-0291
email: [email protected]
commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/lakshyajain-0291/gencli"
description: "GenCLI - A Gemini-Powered interactable CLI for fast, accurate file search."
license: MIT
skip_upload: false
repository:
owner: lakshyajain-0291
name: scoop-gencli
branch: main
pull_request:
enabled: false
# scoops:
# - name: gencli
# url_template: "https://github.com/lakshyajain-0291/gencli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# commit_author:
# name: lakshyajain-0291
# email: [email protected]
# commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"
# homepage: "https://github.com/lakshyajain-0291/gencli"
# description: "GenCLI - A Gemini-Powered interactable CLI for fast, accurate file search."
# license: MIT
# skip_upload: false
# repository:
# owner: lakshyajain-0291
# name: scoop-gencli
# branch: main
# pull_request:
# enabled: false
2 changes: 1 addition & 1 deletion cli/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewConfigCommand() *cobra.Command {
cmd.Flags().StringSliceVar(&deleteSkipTypes, "del-skiptypes", []string{}, "List of file types to stop skipping during indexing")
cmd.Flags().StringSliceVar(&addSkipFiles, "add-skipfiles", []string{}, "List of files to skip during indexing")
cmd.Flags().StringSliceVar(&deleteSkipFiles, "del-skipfiles", []string{}, "List of files to stop skipping during indexing")
cmd.Flags().Float32VarP(&relevanceIndex, "relindex", "r", 0.8, "Relevance Value used during Indexing")
cmd.Flags().Float32VarP(&relevanceIndex, "relindex", "r", 0.35, "Relevance Value used during Indexing")
cmd.Flags().BoolVarP(&showConfig, "show-config", "s", false, "Show the current configuration")
cmd.Flags().StringSliceVar(&addAPIKeys, "add-apikeys", []string{}, "List of API keys to add")
cmd.Flags().StringSliceVar(&deleteAPIKeys, "del-apikeys", []string{}, "List of API keys to remove")
Expand Down
25 changes: 25 additions & 0 deletions cli/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"gemini_cli_tool/fileinfo"
"gemini_cli_tool/gemini"
"os/exec"
"runtime"

"github.com/spf13/cobra"
)
Expand All @@ -25,9 +27,32 @@ func searchFilesCmd(cmd *cobra.Command, args []string) error {

fmt.Printf("\n%s \n\n%s %s\n\n%s %s\\%s\n\n%s %s\n", fileinfo.Green("Most relevelent file is -"), fileinfo.Yellow("File :"), file.Name, fileinfo.Yellow("File path :"), file.Directory, file.Name, fileinfo.Yellow("Description :"), file.Description)

filePath := file.Directory + "\\" + file.Name

err = openFile(filePath)
if err != nil {
return fmt.Errorf("failed to open the file: %v", err)
}

return nil
}

func openFile(filePath string) error {
switch runtime.GOOS {
case "windows":
// On Windows, use "explorer" to open the file in its associated application
return exec.Command("explorer", filePath).Start()
case "darwin":
// On macOS, use "open" command
return exec.Command("open", filePath).Start()
case "linux":
// On Linux, use "xdg-open" command
return exec.Command("xdg-open", filePath).Start()
default:
return fmt.Errorf("unsupported platform")
}
}

func searchFiles(query string) (*fileinfo.FileInfo, error) {
// spinners.start()

Expand Down

0 comments on commit c9bb5a0

Please sign in to comment.