mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
* Strip off the `.nix' suffix from the attribute name for files in
~/.nix-defexpr, otherwise the attribute cannot be selected with the `-A' option. Useful if you want to stick a Nix expression directly in ~/.nix-defexpr.
This commit is contained in:
parent
cc826dc03e
commit
b428adc267
5 changed files with 27 additions and 6 deletions
|
@ -1046,6 +1046,12 @@ bool string2Int(const string & s, long long & n)
|
|||
}
|
||||
|
||||
|
||||
bool hasSuffix(const string & s, const string & suffix)
|
||||
{
|
||||
return s.size() >= suffix.size() && string(s, s.size() - suffix.size()) == suffix;
|
||||
}
|
||||
|
||||
|
||||
void ignoreException()
|
||||
{
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue