Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 13 additions & 1 deletion setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import os
import sys
import shutil

import pipes
from distutils import log
Expand Down Expand Up @@ -348,7 +349,16 @@ def should_run_npm(self):
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")
Expand All @@ -372,6 +382,8 @@ def run(self):
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)
Expand Down
Loading