diff --git a/Cargo.toml b/Cargo.toml index 14316f8..6dc5080 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ keywords = ["core blockchain", "xcb", "cli"] license = "MIT OR Apache-2.0" homepage = "https://github.com/core-coin/core-cli" repository = "https://github.com/core-coin/core-cli" -version = "0.0.5" +version = "0.0.6" [workspace.dependencies] # Workspace members diff --git a/install b/install index 7d35049..c74b400 100644 --- a/install +++ b/install @@ -102,8 +102,21 @@ main() { # Add the .core-cli directory to the PATH case "$_ostype" in linux|darwin) - if ! grep -q "$core_cli_dir" "$HOME/.profile"; then + profile_files=("$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zshrc") + profile_file_found=false + for profile_file in "${profile_files[@]}"; do + if [ -f "$profile_file" ]; then + profile_file_found=true + if ! grep -q "$core_cli_dir" "$profile_file"; then + echo "export PATH=\$PATH:$core_cli_dir" >> "$profile_file" + export PATH=$PATH:$core_cli_dir + fi + fi + done + if [ "$profile_file_found" = false ]; then + touch "$HOME/.profile" echo "export PATH=\$PATH:$core_cli_dir" >> "$HOME/.profile" + export PATH=$PATH:$core_cli_dir fi ;; windows)