Skip to content

Commit

Permalink
fix: Fix git error with --override-filename
Browse files Browse the repository at this point in the history
for flakes

Closes #282
  • Loading branch information
ede1998 committed Nov 18, 2024
1 parent 48d803a commit 103dd72
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nix_update/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 103dd72

Please sign in to comment.