diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcadc42..ba95a67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v2 - uses: actions-rs/install@v0.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index dba3e81..d8c0be7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nushell: errors on 0.33.0. - PowerShell: errors when initializing in `StrictMode`. +- Bash/POSIX: remove conflicting alias definitions when initializing. ## [0.7.2] - 2021-06-10 diff --git a/shell.nix b/shell.nix index 5111918..887f6a6 100644 --- a/shell.nix +++ b/shell.nix @@ -1,28 +1,36 @@ let - pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/20.09.tar.gz") {}; - pkgs-master = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/8e4c6b845965440850eaec79db7086e5d9e350fd.tar.gz") {}; - pkgs-python = pkgs-master.python3.withPackages (pkgs: [ pkgs.black pkgs.mypy pkgs.pylint ]); + rust = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); + pkgs = import { overlays = [ rust ]; }; + pkgs-latest = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/94e725d3299cbeb71419758d671dfb0771b8e318.tar.gz") {}; + pkgs-python = pkgs-latest.python3.withPackages (pkgs: [ pkgs.black pkgs.mypy pkgs.pylint ]); in pkgs.mkShell { buildInputs = [ - pkgs-master.cargo-audit - pkgs-master.elvish - pkgs-master.nushell - pkgs-master.shellcheck - pkgs-master.shfmt + # Rust + pkgs.rust-bin.stable.latest.default + + # Shells + pkgs-latest.bash + pkgs-latest.dash + pkgs-latest.elvish + pkgs-latest.nushell + pkgs-latest.fish + pkgs-latest.powershell + pkgs-latest.xonsh + pkgs-latest.zsh + + # Linters + pkgs-latest.cargo-audit + pkgs-latest.shellcheck + pkgs-latest.shfmt pkgs-python - pkgs.bash - pkgs.cargo - pkgs.clippy - pkgs.dash - pkgs.fish - pkgs.fzf - pkgs.git - pkgs.powershell - pkgs.rustc - pkgs.rustfmt - pkgs.xonsh - pkgs.zsh + + # Dependencies + pkgs.cacert + pkgs.libiconv + pkgs-latest.fzf + pkgs-latest.git ]; + RUST_BACKTRACE = 1; } diff --git a/src/shell.rs b/src/shell.rs index dc7efa7..48d60f5 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -399,7 +399,7 @@ mod tests { let source = Zsh(&opts).render().unwrap(); Command::new("zsh") - .args(&["-c", &source, "--no-rcs"]) + .args(&["-c", &source, "--no-globalrcs", "--no-rcs"]) .assert() .success() .stdout("") diff --git a/templates/bash.txt b/templates/bash.txt index e0b1cef..9a11b5f 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -109,10 +109,9 @@ function __zoxide_zi() { # Remove definitions. function __zoxide_unset() { - # shellcheck disable=SC1001 \builtin unset -f "$@" &>/dev/null - # shellcheck disable=SC1001 \builtin unset -v "$@" &>/dev/null + \builtin unalias "$@" &>/dev/null || \builtin : } __zoxide_unset '{{cmd}}' diff --git a/templates/posix.txt b/templates/posix.txt index 05a776a..add0121 100644 --- a/templates/posix.txt +++ b/templates/posix.txt @@ -92,10 +92,10 @@ __zoxide_zi() { # Remove definitions. __zoxide_unset() { - # shellcheck disable=SC1001 \unset -f "$@" >/dev/null 2>&1 - # shellcheck disable=SC1001 \unset -v "$@" >/dev/null 2>&1 + # shellcheck disable=SC1001 + \unalias "$@" >/dev/null 2>&1 || \: } __zoxide_unset '{{cmd}}'