File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,15 @@ program
42
42
. command ( 'eject [targetDir]' )
43
43
. description ( 'copy the default theme into .vuepress/theme for customization.' )
44
44
. action ( async ( dir = '.' ) => {
45
- const { copy } = require ( 'fs-extra' )
45
+ const fs = require ( 'fs-extra' )
46
46
const source = path . resolve ( __dirname , '../lib/default-theme' )
47
47
const target = path . resolve ( dir , '.vuepress/theme' )
48
- await copy ( source , target )
48
+ await fs . copy ( source , target )
49
+ // remove the import to default theme override
50
+ const styleConfig = path . resolve ( target , 'styles/config.styl' )
51
+ const content = await fs . readFile ( styleConfig , 'utf-8' )
52
+ const transformed = content . split ( '\n' ) . slice ( 0 , - 2 ) . join ( '\n' )
53
+ await fs . writeFile ( styleConfig , transformed )
49
54
console . log ( `Copied default theme into ${ chalk . cyan ( target ) } .` )
50
55
} )
51
56
You can’t perform that action at this time.
0 commit comments