diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 020f22ecd339..c15502387211 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -85,10 +85,15 @@ let runHook preBuild if [ ${deleteFlag} == "true" ]; then - rm -rf vendor + if [ ! -d vendor ]; then + echo "vendor folder does not exist, 'deleteVendor' is not needed" + exit 10 + else + rm -rf vendor + fi fi - if [ -e vendor ]; then + if [ -d vendor ]; then echo "vendor folder exists, please set 'vendorSha256 = null;' in your expression" exit 10 fi