fredrikekre / jlpkg

A command line interface (CLI) for Pkg, Julia's package manager.
MIT License
92 stars 4 forks source link

How to add the path? #24

Closed zdlspace0528 closed 2 years ago

zdlspace0528 commented 2 years ago
julia> import jlpkg;jlpkg.install()
[ Info: Installed jlpkg to `~/.julia/bin/jlpkg`.
┌ Warning: `Sys.which("jlpkg")` returns `nothing`, meaning that `command`
│ can not be found in PATH. Either make sure that `/Users/zhangdeliang/.julia/bin` is in PATH,
│ or manually add a symlink from a directory in PATH to the installed
│ program file.
│ Path to installed program:
│     /Users/zhangdeliang/.julia/bin/jlpkg
└ @ jlpkg ~/.julia/packages/jlpkg/ZwCoa/src/jlpkg.jl:72

How to set the path?

fredrikekre commented 2 years ago

Hi, didn't notice this issue until now.

Adding a folder to PATH is typically done in your shell startup configuration, (~/.bashrc for Bash, ~/.zshrc for Zsh, etc..). For example you can put this in that file to prepend the .julia/bin folder to the existing PATH:

PATH="${HOME}/.julia/bin:${PATH}"
export PATH

Note that, if you prefer, you can install the file to a folder that already exist in PATH (you can see the existing directories in path by echo ${PATH} in the shell). You do this by passing the destdir keyword argument to jlpkg.install.