Skip to content

Commit

Permalink
fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Jun 26, 2023
1 parent dc7e8cf commit 0fc25d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drv-tools/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@
readFiles = dir: readXs dir "regular";
readDirectories = dir: readXs dir "directory";
readSymlinks = dir: readXs dir "symlink";
subDirectories = dir: builtins.map (x: "${builtins.baseNameOf dir}/${x}") (readDirectories dir);

# get a list of immediate subdirectories
# pwd should be an absolute path like ./.
subDirectories = pwd: dir: builtins.map (x: "${dir}/${x}") (readDirectories "${pwd}/${dir}");

# assuming that a `pname` of a program coincides with its main executable's name
# !unsafe to use with packages whose pname may change!
Expand Down Expand Up @@ -465,6 +468,7 @@
};

tests = {
s = subDirectories ../. "templates";
t = readFiles ./.;
accessors = mkAccessors_ "pref" {
a.b.c = "";
Expand Down

0 comments on commit 0fc25d9

Please sign in to comment.