@@ -3,10 +3,13 @@ const fs = require('sander')
3
3
const { remote } = require ( 'electron' )
4
4
const { app } = remote
5
5
6
+ const CODEMIRROR_THEME_PATH = 'node_modules/codemirror/theme'
7
+ const CODEMIRROR_EXTRA_THEME_PATH = 'extra_scripts/codemirror/theme'
8
+
6
9
const isProduction = process . env . NODE_ENV === 'production'
7
10
const paths = [
8
- isProduction ? path . join ( app . getAppPath ( ) , './node_modules/codemirror/theme' ) : path . resolve ( './node_modules/codemirror/theme' ) ,
9
- isProduction ? path . join ( app . getAppPath ( ) , './extra_scripts/codemirror/theme' ) : path . resolve ( './extra_scripts/codemirror/theme' )
11
+ isProduction ? path . join ( app . getAppPath ( ) , CODEMIRROR_THEME_PATH ) : path . resolve ( CODEMIRROR_THEME_PATH ) ,
12
+ isProduction ? path . join ( app . getAppPath ( ) , CODEMIRROR_EXTRA_THEME_PATH ) : path . resolve ( CODEMIRROR_EXTRA_THEME_PATH )
10
13
]
11
14
12
15
const themes = paths
@@ -24,17 +27,17 @@ const themes = paths
24
27
25
28
themes . splice ( themes . findIndex ( ( { name } ) => name === 'solarized' ) , 1 , {
26
29
name : 'solarized dark' ,
27
- path : 'node_modules/codemirror/theme/ solarized.css' ,
30
+ path : ` ${ CODEMIRROR_THEME_PATH } / solarized.css` ,
28
31
className : `cm-s-solarized cm-s-dark`
29
32
} , {
30
33
name : 'solarized light' ,
31
- path : 'node_modules/codemirror/theme/ solarized.css' ,
34
+ path : ` ${ CODEMIRROR_THEME_PATH } / solarized.css` ,
32
35
className : `cm-s-solarized cm-s-light`
33
36
} )
34
37
35
38
themes . splice ( 0 , 0 , {
36
39
name : 'default' ,
37
- path : '/node_modules/codemirror/theme/ elegant.css' ,
40
+ path : ` ${ CODEMIRROR_THEME_PATH } / elegant.css` ,
38
41
className : `cm-s-default`
39
42
} )
40
43
0 commit comments