Skip to content

Commit

Permalink
Merge pull request #2066 from jupyter/cm-up
Browse files Browse the repository at this point in the history
Patch CodeMirror 5.22
  • Loading branch information
minrk authored Jan 25, 2017
2 parents 5721d7c + 0e38b00 commit 393a04d
Show file tree
Hide file tree
Showing 3 changed files with 9,135 additions and 1 deletion.
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
10 changes: 10 additions & 0 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ def npm_components(self):
shutil.rmtree(bower_pkg)
shutil.copytree(npm_pkg, bower_pkg)

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 @@ -398,6 +407,7 @@ 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()
self.npm_components()
os.utime(self.bower_dir, None)
# update package data in case this created new files
Expand Down
Loading

0 comments on commit 393a04d

Please sign in to comment.