From 103dd7277a529f36050e86e67a65c62c7cba7127 Mon Sep 17 00:00:00 2001 From: ede1998 Date: Tue, 19 Nov 2024 00:22:25 +0100 Subject: [PATCH] fix: Fix git error with --override-filename for flakes Closes #282 --- nix_update/eval.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nix_update/eval.py b/nix_update/eval.py index 9d694a9..6516014 100644 --- a/nix_update/eval.py +++ b/nix_update/eval.py @@ -86,6 +86,8 @@ def __post_init__( self.version_position = None else: self.version_position = Position(**raw_version_position) + if self.filename: + self.version_position.file = self.filename if raw_cargo_lock is None: self.cargo_lock = NoCargoLock() @@ -221,11 +223,11 @@ def eval_attr(opts: Options) -> Package: ] + opts.extra_flags res = run(cmd) out = json.loads(res.stdout) - package = Package(attribute=opts.attribute, import_path=opts.import_path, **out) if opts.override_filename is not None: - package.filename = opts.override_filename + out["filename"] = opts.override_filename if opts.url is not None: - package.parsed_url = urlparse(opts.url) + out["url"] = opts.url + package = Package(attribute=opts.attribute, import_path=opts.import_path, **out) if opts.version_preference != VersionPreference.SKIP and package.old_version == "": raise UpdateError( f"Nix's builtins.parseDrvName could not parse the version from {package.name}"