Skip to content

Commit 2a0dce7

Browse files
committed
regenerate: print good error for missing node_modules directory
related to #7
1 parent f69033b commit 2a0dce7

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

internal/codemirror/bull-codemirror.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
// in the bull/third_party/codemirror directory:
1+
// To re-generate the CodeMirror editor JavaScript bundle with the currently
2+
// used versions, run regenerate.sh.
23
//
3-
// npm install codemirror
4-
// npm install codemirror/lang-markdown
4+
// To update to a new CodeMirror version, run:
5+
//
6+
// (cd third_party/codemirror && npm install codemirror)
7+
// (cd third_party/codemirror && npm install codemirror/lang-markdown)
58

69
import {EditorView} from "codemirror"
710
import {markdown} from "@codemirror/lang-markdown"

regenerate.sh

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#!/bin/sh
22

3+
if [ ! -d "third_party/codemirror/node_modules" ]
4+
then
5+
echo "Cannot re-generate CodeMirror JavaScript bundle:" >&2
6+
echo "" >&2
7+
echo " No node_modules directory found in third_party/codemirror!" >&2
8+
echo "" >&2
9+
echo "To install the CodeMirror editor and dependencies into third_party," >&2
10+
echo "install the npm JavaScript package manager and run:" >&2
11+
echo "" >&2
12+
echo " (cd third_party/codemirror && npm install)" >&2
13+
echo "" >&2
14+
exit 2
15+
fi
16+
317
export NODE_PATH=$PWD/third_party/codemirror/node_modules
418
go tool esbuild \
519
internal/codemirror/bull-codemirror.ts \

0 commit comments

Comments
 (0)