chore: update pin_dependencies.py (#9051)

This commit is contained in:
jrandolf 2022-10-05 16:19:18 +02:00 committed by GitHub
parent d4c6ff1268
commit bafdb4784c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,14 +22,15 @@ from tempfile import mktemp
def main(): def main():
for package_json_path in glob("**/package.json"): for package_json_path in glob("packages/*/package.json") + ["website/package.json"]:
print(package_json_path)
tmp_file_path = mktemp() tmp_file_path = mktemp()
with open(tmp_file_path, 'w') as tmp_file: with open(tmp_file_path, 'w') as tmp_file:
with open(package_json_path, "r") as package_json_file: with open(package_json_path, "r") as package_json_file:
start_replace = False start_replace = False
for line in package_json_file.readlines(): for line in package_json_file.readlines():
if not start_replace: if not start_replace:
if line.startswith("devDependencies") or line.startswith("dependencies"): if "devDependencies" in line or "dependencies" in line:
start_replace = True start_replace = True
else: else:
line = line.replace('^', '') line = line.replace('^', '')