Skip to content

Commit cd258ca

Browse files
authored
Merge pull request #2090 from Carreau/backport-2066
Backport PR #2066 on branch 4.x
2 parents b5a431f + 3ce1670 commit cd258ca

File tree

3 files changed

+9138
-2
lines changed

3 files changed

+9138
-2
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"backbone": "components/backbone#~1.2",
66
"bootstrap": "components/bootstrap#~3.3",
77
"bootstrap-tour": "0.9.0",
8-
"codemirror": "components/codemirror#~5.16",
8+
"codemirror": "components/codemirror#~5.22.2",
99
"es6-promise": "~1.0",
1010
"font-awesome": "components/font-awesome#~4.2.0",
1111
"google-caja": "5669",

setupbase.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import os
1717
import sys
18+
import shutil
1819

1920
import pipes
2021
from distutils import log
@@ -348,7 +349,16 @@ def should_run_npm(self):
348349
if not os.path.exists(self.node_modules):
349350
return True
350351
return mtime(self.node_modules) < mtime(pjoin(repo_root, 'package.json'))
351-
352+
353+
def patch_codemirror(self):
354+
"""Patch CodeMirror until https://github.com/codemirror/CodeMirror/issues/4454 is resolved"""
355+
356+
try:
357+
shutil.copyfile('tools/patches/codemirror.js', 'notebook/static/components/codemirror/lib/codemirror.js')
358+
except OSError as e:
359+
print("Failed to patch codemirror.js: %s" % e, file=sys.stderr)
360+
raise
361+
352362
def run(self):
353363
if not self.should_run():
354364
print("bower dependencies up to date")
@@ -372,6 +382,8 @@ def run(self):
372382
print("Failed to run bower: %s" % e, file=sys.stderr)
373383
print("You can install js dependencies with `npm install`", file=sys.stderr)
374384
raise
385+
386+
self.patch_codemirror()
375387
os.utime(self.bower_dir, None)
376388
# update package data in case this created new files
377389
update_package_data(self.distribution)

0 commit comments

Comments
 (0)