From a216b64c9d4c156d4ef4342efa3b8203c89b13a5 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 20 Jul 2020 15:06:21 +0200 Subject: [PATCH] Add script to compare npm versions --- compare_packages.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 compare_packages.py diff --git a/compare_packages.py b/compare_packages.py new file mode 100755 index 000000000..6047d8a81 --- /dev/null +++ b/compare_packages.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# This script compares the npm packages version in the Luxembourg +# project with the ones in ngeo. +# Make sure to call "npm i" in the geoportal directory before running the script. + +import json + +with open('./geoportal/package.json') as json_file: + lux_deps = json.load(json_file)['devDependencies'] + with open('./geoportal/node_modules/ngeo/package.json') as ngeo_file: + ngeo_deps = json.load(ngeo_file)['devDependencies'] + for name, version in lux_deps.items(): + if name in ngeo_deps: + ngeo_version = ngeo_deps[name] + if ngeo_version != version: + print(name, version, '->', ngeo_version)