From 884459a783f536b26a2bf08617a7d9354f210c5f Mon Sep 17 00:00:00 2001 From: traxys Date: Sat, 3 Sep 2022 22:08:13 +0200 Subject: [PATCH] Correctly do cargo completions --- rustdev.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rustdev.nix b/rustdev.nix index bbaf173..802befc 100644 --- a/rustdev.nix +++ b/rustdev.nix @@ -16,7 +16,9 @@ home.file = { ".zfunc/_cargo".text = '' #compdef cargo - source $(rustc --print sysroot)/share/zsh/site-functions/_cargo + if command -v rustc >/dev/null 2>&1; then + source "$(rustc --print sysroot)"/share/zsh/site-functions/_cargo + fi ''; }; }