Skip to content

Commit

Permalink
default attribute to $UPDATE_NIX_ATTR_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Dec 25, 2022
1 parent bb901a3 commit 71fbce4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nix_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 71fbce4

Please sign in to comment.