tv vim: simplify wrapper

This commit is contained in:
tv 2016-02-07 08:09:07 +01:00
parent 698296eb8c
commit ee5a1ddffe

View File

@ -44,13 +44,9 @@ let
alldirs = attrValues dirs ++ map dirOf (attrValues files); alldirs = attrValues dirs ++ map dirOf (attrValues files);
in unique (sort lessThan alldirs); in unique (sort lessThan alldirs);
vim = pkgs.writeScriptBin "vim" '' vim = pkgs.writeDashBin "vim" ''
#! ${pkgs.dash}/bin/dash set -efu
set -f (umask 0077; exec ${pkgs.coreutils}/bin/mkdir -p ${toString mkdirs})
umask=$(umask)
umask 0077
${concatStringsSep "\n" (map (x: "mkdir -p ${x}") mkdirs)}
umask "$umask"
exec ${pkgs.vim}/bin/vim "$@" exec ${pkgs.vim}/bin/vim "$@"
''; '';