Skip to content

Commit

Permalink
Merge pull request #120 from figsoda/update-script
Browse files Browse the repository at this point in the history
default attribute to $UPDATE_NIX_ATTR_PATH
  • Loading branch information
figsoda authored Dec 25, 2022
2 parents 018cd5f + 71fbce4 commit 04561b9
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 04561b9

Please sign in to comment.