Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/177583
Change subject: bin: Update update-unicodejs.sh to parity with update-oojs.sh
......................................................................
bin: Update update-unicodejs.sh to parity with update-oojs.sh
Change-Id: I80e78eb8de78f81b7f046bc4f9bc647fff5cafc3
---
M bin/update-unicodejs.sh
1 file changed, 11 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/83/177583/1
diff --git a/bin/update-unicodejs.sh b/bin/update-unicodejs.sh
index e3268ee..ed4822f 100755
--- a/bin/update-unicodejs.sh
+++ b/bin/update-unicodejs.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
+# This script generates a commit that updates our copy of UnicodeJS
+
if [ -n "$2" ]
then
# Too many parameters
@@ -7,25 +9,25 @@
exit 1
fi
-REPO_DIR=$(cd $(dirname $0)/..; pwd) # Root dir of the git repo working tree
-TARGET_DIR=lib/unicodejs # Destination relative to the root of the repo
-NPM_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'update-unicodejs'` # e.g.
/tmp/update-unicodejs.rI0I5Vir
+REPO_DIR=$(cd "$(dirname $0)/.."; pwd) # Root dir of the git repo working tree
+TARGET_DIR="lib/unicodejs" # Destination relative to the root of the repo
+NPM_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'update-unicodejs') # e.g.
/tmp/update-unicodejs.rI0I5Vir
# Prepare working tree
-cd $REPO_DIR &&
-git reset $TARGET_DIR && git checkout $TARGET_DIR && git fetch origin &&
+cd "$REPO_DIR" &&
+git reset -- $TARGET_DIR && git checkout -- $TARGET_DIR && git fetch origin &&
git checkout -B upstream-unicodejs origin/master || exit 1
# Fetch upstream version
cd $NPM_DIR
if [ -n "$1" ]
then
- npm install unicodejs@$1 || exit 1
+ npm install "unicodejs@$1" || exit 1
else
npm install unicodejs || exit 1
fi
-UNICODEJS_VERSION=$(node -e
'console.log(JSON.parse(require("fs").readFileSync("./node_modules/unicodejs/package.json")).version);')
+UNICODEJS_VERSION=$(node -e
'console.log(require("./node_modules/unicodejs/package.json").version);')
if [ "$UNICODEJS_VERSION" == "" ]
then
echo 'Could not find UnicodeJS version'
@@ -33,10 +35,10 @@
fi
# Copy file(s)
-rsync --recursive --delete --force ./node_modules/unicodejs/dist
$REPO_DIR/$TARGET_DIR || exit 1
+rsync --force ./node_modules/unicodejs/dist/unicodejs.js
"$REPO_DIR/$TARGET_DIR" || exit 1
# Clean up temporary area
-rm -rf $NPM_DIR
+rm -rf "$NPM_DIR"
# Generate commit
cd $REPO_DIR || exit 1
--
To view, visit https://gerrit.wikimedia.org/r/177583
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I80e78eb8de78f81b7f046bc4f9bc647fff5cafc3
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits