mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 00:55:58 -05:00
feat: add path.get-directory-name helper for consistent directory name extraction
This commit is contained in:
@@ -133,5 +133,18 @@ in
|
||||
#@ Path -> String
|
||||
get-output-name = path:
|
||||
builtins.unsafeDiscardStringContext (get-parent-directory path);
|
||||
|
||||
## Get the directory name for flake outputs.
|
||||
## Example Usage:
|
||||
## ```nix
|
||||
## get-directory-name /templates/foo
|
||||
## ```
|
||||
## Result:
|
||||
## ```nix
|
||||
## "foo"
|
||||
## ```
|
||||
#@ Path -> String
|
||||
get-directory-name = path:
|
||||
builtins.unsafeDiscardStringContext (baseNameOf path);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ in
|
||||
description = flake-attrs.description or null;
|
||||
in
|
||||
{
|
||||
name = builtins.unsafeDiscardStringContext (baseNameOf template);
|
||||
name = snowfall-lib.path.get-directory-name template;
|
||||
path = template;
|
||||
}
|
||||
// (if description != null then { inherit description; } else { });
|
||||
|
||||
Reference in New Issue
Block a user