Skip to content

Commit

Permalink
Use just source as default name
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Mar 23, 2020
1 parent 9d98d1c commit 66cfe7b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/clean-source-with.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@
# If you do not provide a `name` it wil be derived
# from the `subDir`. You should provide `name` or
# `subDir`. If you do not a warning will be displayed
# and the name used will be `source-${caller}`.
# and the name used will be `source`.
#
# caller: Name of the function used in warning message and
# in the default `source-${caller}` name. Functions
# that are implemented using `cleanSourceWith` (and
# forward a `name` argument) can use this to make
# caller: Name of the function used in warning message.
# Functions that are implemented using `cleanSourceWith`
# (and forward a `name` argument) can use this to make
# the message to the use more meaningful.
#
cleanSourceWith = { filter ? _path: _type: true, src, subDir ? "", name ? null
Expand Down Expand Up @@ -74,7 +73,7 @@
if subDirName != ""
then if src ? name
then src.name + "-" + subDirName
else "source-${caller}-" + subDirName
else "source-" + subDirName
else if src ? name
then src.name
else
Expand All @@ -95,7 +94,7 @@
# * A default name that gives a hint as to why there is no name.
__trace (
"WARNING: `${caller}` called on ${toString src} without a `name`. "
+ "Consider adding `name = \"${baseNameOf src};\"`") "source-${caller}";
+ "Consider adding `name = \"${baseNameOf src};\"`") "source";
in {
inherit origSrc origSubDir origSrcSubDir;
filter = filter';
Expand Down

0 comments on commit 66cfe7b

Please sign in to comment.