mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 21:13:28 +01:00
types,module,tests: run shellcheck on scripts before running them in NixOS tests
This commit is contained in:
1 parent
9afae0ba36
commit
0accdf4e20
5 files changed
+38
-25
No files matched your search
@@ -193,6 +193,15 @@ rec {
|
||||
description = "Mount script";
|
||||
};
|
||||
|
||||
/* Writer for optionally checking bash scripts before writing them to the store
|
||||
|
||||
writeCheckedBash :: AttrSet -> str -> str -> derivation
|
||||
*/
|
||||
writeCheckedBash = { pkgs, checked ? false, noDeps ? false }: pkgs.writers.makeScriptWriter {
|
||||
interpreter = if noDeps then "/usr/bin/env bash" else "${pkgs.bash}/bin/bash";
|
||||
check = lib.optionalString checked "${pkgs.shellcheck}/bin/shellcheck";
|
||||
};
|
||||
|
||||
|
||||
/* Takes a disko device specification, returns an attrset with metadata
|
||||
|
||||
|
||||
Reference in new issue
Block a user