Allow to execute update script in CI environment

If the script is executed in a CI (like in github actions, with the
install-nix-action) it fails. This changes fixes that use case. In that
scenario, you should provide the --no-commit flag.
This commit is contained in:
José Luis Lafuente 2021-09-03 11:48:07 +02:00 committed by Matthieu Coudron
parent 130496a800
commit b891957a97

View file

@ -547,7 +547,6 @@ def update_plugins(editor: Editor, args):
log.setLevel(LOG_LEVELS[args.debug])
log.info("Start updating plugins")
nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
update = editor.get_update(args.input_file, args.outfile, args.proc)
redirects = update()
@ -556,6 +555,7 @@ def update_plugins(editor: Editor, args):
autocommit = not args.no_commit
if autocommit:
nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
commit(nixpkgs_repo, f"{editor.attr_path}: update", [args.outfile])
if redirects: