From cf51a23ff177339535fb5111707a39e909e60861 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 25 Nov 2014 02:35:29 +0000 Subject: [PATCH] Maintenance: Simplify reading of package.json by using require() Change-Id: Ifdee4733527cca8353cb9b59d6079939fdd7309e --- maintenance/resources/update-oojs-ui.sh | 2 +- maintenance/resources/update-oojs.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maintenance/resources/update-oojs-ui.sh b/maintenance/resources/update-oojs-ui.sh index bfa2eb021b..a20b83be8e 100755 --- a/maintenance/resources/update-oojs-ui.sh +++ b/maintenance/resources/update-oojs-ui.sh @@ -27,7 +27,7 @@ else npm install oojs-ui || exit 1 fi -OOJSUI_VERSION=$(node -e 'console.log(JSON.parse(require("fs").readFileSync("./node_modules/oojs-ui/package.json")).version);') +OOJSUI_VERSION=$(node -e 'console.log(require("./node_modules/oojs-ui/package.json").version);') if [ "$OOJSUI_VERSION" == "" ] then echo 'Could not find OOjs UI version' diff --git a/maintenance/resources/update-oojs.sh b/maintenance/resources/update-oojs.sh index 8627c7199c..1d5c2b1709 100755 --- a/maintenance/resources/update-oojs.sh +++ b/maintenance/resources/update-oojs.sh @@ -27,7 +27,7 @@ else npm install oojs || exit 1 fi -OOJS_VERSION=$(node -e 'console.log(JSON.parse(require("fs").readFileSync("./node_modules/oojs/package.json")).version);') +OOJS_VERSION=$(node -e 'console.log(require("./node_modules/oojs/package.json").version);') if [ "$OOJS_VERSION" == "" ] then echo 'Could not find OOjs version' -- 2.20.1