Skip to content

Commit 3ff51e1

Browse files
squalusyayayayaka
authored andcommitted
electron: fix update script
The nix-universal-prefetch package was deleted in 578d7e7. Switch to nurl. Fixes #321490
1 parent 7ec2580 commit 3ff51e1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkgs/development/tools/electron/update.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env nix-shell
2-
#! nix-shell -i python -p python3.pkgs.joblib python3.pkgs.click python3.pkgs.click-log nix nix-prefetch-git nix-universal-prefetch prefetch-yarn-deps prefetch-npm-deps
2+
#! nix-shell -i python -p python3.pkgs.joblib python3.pkgs.click python3.pkgs.click-log nix nix-prefetch-git nurl prefetch-yarn-deps prefetch-npm-deps
33
"""
44
electron updater
55
@@ -83,6 +83,7 @@
8383
logger = logging.getLogger(__name__)
8484
click_log.basic_config(logger)
8585

86+
nixpkgs_path = os.path.dirname(os.path.realpath(__file__)) + "/../../../.."
8687

8788
class Repo:
8889
fetcher: str
@@ -304,11 +305,11 @@ def supported_version_range() -> range:
304305

305306
@memory.cache
306307
def get_repo_hash(fetcher: str, args: dict) -> str:
307-
cmd = ["nix-universal-prefetch", fetcher]
308-
for arg_name, arg in args.items():
309-
cmd.append(f"--{arg_name}")
310-
cmd.append(arg)
311-
308+
expr = f'with import {nixpkgs_path} {{}};{fetcher}{{'
309+
for key, val in args.items():
310+
expr += f'{key}="{val}";'
311+
expr += '}'
312+
cmd = ["nurl", "-H", "--expr", expr]
312313
print(" ".join(cmd), file=sys.stderr)
313314
out = subprocess.check_output(cmd)
314315
return out.decode("utf-8").strip()

0 commit comments

Comments
 (0)