Skip to content

fl4vis/sonar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compile the program:

go build -o sonar

Create a shell function in your .bashrc or .zshrc: You need to set the file path to your binary

sonar() {
    local selection_file="/tmp/sonar_selection"
    
    # Run interactively TUI 
    <file_path>/sonar "$@"
    exit_code=$?
    
    # Check if selection was made
    if [[ -f "$selection_file" && "$exit_code" -eq 0 ]]; then
        target_dir="$(cat "$selection_file")"
        rm -f "$selection_file"
        
        if [[ -n "$target_dir" ]]; then
            cd "$target_dir" || echo "Failed to cd into $target_dir"
        fi
    fi

}

Source your shell configuration:

source ~/.bashrc  # or ~/.zshrc

Now you can run:

sonar

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages