Merge pull request #2090 from Carreau/backport-2066

Backport PR #2066 on branch 4.x
pull/2103/head
Min RK 9 years ago committed by GitHub
commit cd258caec4

@ -5,7 +5,7 @@
"backbone": "components/backbone#~1.2",
"bootstrap": "components/bootstrap#~3.3",
"bootstrap-tour": "0.9.0",
"codemirror": "components/codemirror#~5.16",
"codemirror": "components/codemirror#~5.22.2",
"es6-promise": "~1.0",
"font-awesome": "components/font-awesome#~4.2.0",
"google-caja": "5669",

@ -15,6 +15,7 @@ from __future__ import print_function
import os
import sys
import shutil
import pipes
from distutils import log
@ -348,7 +349,16 @@ class Bower(Command):
if not os.path.exists(self.node_modules):
return True
return mtime(self.node_modules) < mtime(pjoin(repo_root, 'package.json'))
def patch_codemirror(self):
"""Patch CodeMirror until https://github.com/codemirror/CodeMirror/issues/4454 is resolved"""
try:
shutil.copyfile('tools/patches/codemirror.js', 'notebook/static/components/codemirror/lib/codemirror.js')
except OSError as e:
print("Failed to patch codemirror.js: %s" % e, file=sys.stderr)
raise
def run(self):
if not self.should_run():
print("bower dependencies up to date")
@ -372,6 +382,8 @@ class Bower(Command):
print("Failed to run bower: %s" % e, file=sys.stderr)
print("You can install js dependencies with `npm install`", file=sys.stderr)
raise
self.patch_codemirror()
os.utime(self.bower_dir, None)
# update package data in case this created new files
update_package_data(self.distribution)

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save