From 8623f2d4a9b2bffdd0ee8aba18c495e6063a59c8 Mon Sep 17 00:00:00 2001 From: paf <paf@titelfrei.de> Date: Tue, 11 May 2021 08:35:37 +0200 Subject: [PATCH] also update package-lock.json --- scripts/new_version.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/new_version.py b/scripts/new_version.py index 2cb0b201..950ff6a1 100755 --- a/scripts/new_version.py +++ b/scripts/new_version.py @@ -29,7 +29,7 @@ import subprocess VERSION_FILE = 'package.json' VERSION_REGEX = '(?<=version": ")(.*)(?=")' -ADDITIONAL_FILES_TO_COMMIT = [] +ADDITIONAL_FILES_TO_COMMIT = ['package-lock.json'] def _check_prerequisites(): @@ -105,6 +105,10 @@ def _undo_version_update_in_files(): for file in ADDITIONAL_FILES_TO_COMMIT: subprocess.run(f"git checkout {file}", shell=True, check=True) +def _update_package_lock(): + print(f"Updating package-lock file") + subprocess.run(f"npm i --package-lock-only", shell=True, check=True) + _check_prerequisites() pattern = re.compile(VERSION_REGEX) @@ -120,4 +124,5 @@ except subprocess.SubprocessError: _stop_software() _undo_version_update_in_files() _stop_software() +_update_package_lock() _git_tag() -- GitLab