godotpath-shell

command module
v0.0.0-...-4aeffdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: OSL-3.0 Imports: 5 Imported by: 0

README

dotpath

Set your shell's PATH from a file, preserving uniqueness.

Why? So you can easily configure your shell's PATH and remove duplicate entries, quickly & without fuss.

This Go version adds ~2.57ms to my shell startup time, compared to the 14-22ms I was getting using basic bash functionality.

Usage

# Build and run
make
eval "$(./dotpath)"

# Test that it worked
echo $PATH | tr ':' '\n' | sort
$ ./dotpath -h
Usage of ./dotpath:
  -allowInvalid
        Add invalid directories to PATH
  -allowMissing
        Add non-existent directories to PATH (default true)
  -file string
        The location of your paths file (default "~/.paths")
  -path string
        PATH to add onto (default "$PATH")

Bash / ZSH / Fish / etc

Add eval "$(./dotpath)" to your ~/.bashrc / whatever your shell's config is called.

# Optional: Add dotpath to your path
mkdir -p ~/.local/bin
cp dotpath ~/.local/bin/

Configuration

Create a file called ~/.paths (or any other name, this is just the default).

Each path has it's own line:

$HOME/.local/bin
$HOME/.local/bin/gradle/bin
$HOME/.cargo/bin
$HOME/.android/sdk/tools/bin
$HOME/.android/sdk/cmdline-tools/latest/bin
$GOPATH/bin

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳