summary refs log tree commit diff
path: root/pkgs/shells/fish
diff options
context:
space:
mode:
authorMartino Fontana <tinozzo123@tutanota.com>2023-04-04 14:49:33 +0200
committerYt <happysalada@proton.me>2023-04-04 11:54:11 -0400
commit460168712363202aaecc2bf608598f1a8957e43d (patch)
tree7e7118baf06e6f7632a2d547cab6968e9a6e5df6 /pkgs/shells/fish
parent51d7be2c343141d2f10d13b8d0413b3f977986cc (diff)
downloadnixpkgs-460168712363202aaecc2bf608598f1a8957e43d.tar
nixpkgs-460168712363202aaecc2bf608598f1a8957e43d.tar.gz
nixpkgs-460168712363202aaecc2bf608598f1a8957e43d.tar.bz2
nixpkgs-460168712363202aaecc2bf608598f1a8957e43d.tar.lz
nixpkgs-460168712363202aaecc2bf608598f1a8957e43d.tar.xz
nixpkgs-460168712363202aaecc2bf608598f1a8957e43d.tar.zst
nixpkgs-460168712363202aaecc2bf608598f1a8957e43d.zip
buildFishPlugin: check if any .fish file exists in source
Diffstat (limited to 'pkgs/shells/fish')
-rw-r--r--pkgs/shells/fish/plugins/build-fish-plugin.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/shells/fish/plugins/build-fish-plugin.nix b/pkgs/shells/fish/plugins/build-fish-plugin.nix
index b5d813133c5..807d5835f1e 100644
--- a/pkgs/shells/fish/plugins/build-fish-plugin.nix
+++ b/pkgs/shells/fish/plugins/build-fish-plugin.nix
@@ -45,9 +45,11 @@ stdenv.mkDerivation (drvAttrs // {
         source="$1"
         target="$out/share/fish/vendor_$2.d"
 
-        [ -d $source ] || return 0
+        # Check if any .fish file exists in $source
+        [ -n "$(shopt -s nullglob; echo $source/*.fish)" ] || return 0
+
         mkdir -p $target
-        cp -r $source/*.fish "$target/"
+        cp $source/*.fish "$target/"
       }
 
       install_vendor_files completions completions