mirror of
https://github.com/Mic92/nix-update.git
synced 2024-11-03 21:04:49 +03:00
default attribute to $UPDATE_NIX_ATTR_PATH
This commit is contained in:
parent
bb901a38a4
commit
71fbce46cf
@ -68,7 +68,15 @@ def parse_args(args: list[str]) -> Options:
|
||||
help="Set filename where nix-update will update version/hash",
|
||||
default=None,
|
||||
)
|
||||
parser.add_argument("attribute", help="Attribute name within the file evaluated")
|
||||
|
||||
default_attribute = os.getenv("UPDATE_NIX_ATTR_PATH")
|
||||
parser.add_argument(
|
||||
"attribute",
|
||||
default=default_attribute,
|
||||
nargs="?" if default_attribute else None, # type: ignore
|
||||
help="Attribute name within the file evaluated",
|
||||
)
|
||||
|
||||
a = parser.parse_args(args)
|
||||
return Options(
|
||||
import_path=os.path.realpath(a.file),
|
||||
|
Loading…
Reference in New Issue
Block a user