3 # FIXME this script is duplicated from update-oojs-ui.sh - factor this out
5 # This script generates a commit that updates the oojs distribution
6 # ./bin/update-oojs.sh path/to/repo/for/oojs
9 grep "OOjs v" resources
/oojs
/oojs.js \
11 |
grep -Eo '\([a-z0-9]+\)' \
17 grep "OOjs v" resources
/oojs
/oojs.js \
19 |
grep -Eo '\bv[0-9a-z.-]+\b'
22 function oojsversion
() {
23 grep "OOjs v" resources
/oojs
/oojs.js \
25 |
grep -Eo '\bv[0-9a-z.-]+\b.*$'
28 # cd to the MW directory
29 cd $
(cd $
(dirname $0)/..
/..
; pwd)
33 echo >&2 "Usage: update-oojs.sh path/to/repo/for/oojs"
37 # Undo any changes in the oojs directory
38 git
reset resources
/oojs
/
39 git checkout resources
/oojs
/
40 # Get the old oojs version
41 OLDVERSION
=$
(oojshash
)
42 if [ "x$OLDVERSION" == "x" ]
47 # cd to the oojs directory
49 if [ "x$OLDVERSION" == "x" ]
52 OLDVERSION
=$
(git rev-parse
$TAG)
55 echo Could not
find OOjs version
60 if [ "$(git rev-parse $OLDVERSION)" == "$(git rev-parse HEAD)" ]
62 echo "No changes (already at $OLDVERSION)"
66 # Build the distribution
68 # Get the list of changes
69 NEWCHANGES
=$
(git log
$OLDVERSION..
--oneline --no-merges --reverse --color=never
)
70 NEWCHANGESDISPLAY
=$
(git log
$OLDVERSION..
--oneline --no-merges --reverse --color=always
)
71 # cd back to the VisualEditor directory
74 # Copy files from dist/ to resources/oojs/
75 cp -a $1/dist
/* resources
/oojs
/
76 # Figure out what the new version is
77 NEWVERSION
=$
(oojsversion
)
78 # Generate commit summary
80 Update OOjs to $NEWVERSION
87 git commit resources
/oojs
/ -m "$COMMITMSG"
91 Created commit with changes: