···311 Similar to writeShellScriptBin and writeScriptBin.
312 Writes an executable Shell script to /nix/store/<store path>/bin/<name> and
313 checks its syntax with shellcheck and the shell's -n option.
00314 Automatically includes sane set of shellopts (errexit, nounset, pipefail)
315 and handles creation of PATH based on runtimeInputs
316···338 , runtimeInputs ? [ ]
339 , meta ? { }
340 , checkPhase ? null
0341 }:
342 writeTextFile {
343 inherit name meta;
···363 # but we still want to use writeShellApplication on those platforms
364 let
365 shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck.compiler;
0366 shellcheckCommand = lib.optionalString shellcheckSupported ''
367 # use shellcheck which does not include docs
368 # pandoc takes long to build and documentation isn't needed for just running the cli
369- ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} "$target"
370 '';
371 in
372 if checkPhase == null then ''
···311 Similar to writeShellScriptBin and writeScriptBin.
312 Writes an executable Shell script to /nix/store/<store path>/bin/<name> and
313 checks its syntax with shellcheck and the shell's -n option.
314+ Individual checks can be foregone by putting them in the excludeShellChecks
315+ list, e.g. [ "SC2016" ].
316 Automatically includes sane set of shellopts (errexit, nounset, pipefail)
317 and handles creation of PATH based on runtimeInputs
318···340 , runtimeInputs ? [ ]
341 , meta ? { }
342 , checkPhase ? null
343+ , excludeShellChecks ? [ ]
344 }:
345 writeTextFile {
346 inherit name meta;
···366 # but we still want to use writeShellApplication on those platforms
367 let
368 shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck.compiler;
369+ excludeOption = lib.optionalString (excludeShellChecks != [ ]) "--exclude '${lib.concatStringsSep "," excludeShellChecks}'";
370 shellcheckCommand = lib.optionalString shellcheckSupported ''
371 # use shellcheck which does not include docs
372 # pandoc takes long to build and documentation isn't needed for just running the cli
373+ ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} ${excludeOption} "$target"
374 '';
375 in
376 if checkPhase == null then ''