File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { exec } from 'child_process' ;
2
2
import { Config } from '../config' ;
3
3
import { copyTemplate , hasYarn , installDeps , runTask } from '../common' ;
4
+ import { writeFileSync } from '../util/fs' ;
5
+ import { join } from 'path' ;
4
6
5
7
export async function addElectron ( config : Config ) {
6
8
7
9
await runTask ( `Adding Electron project in: ${ config . electron . platformDir } ` , async ( ) => {
8
- return copyTemplate ( config . electron . assets . templateDir , config . electron . platformDir ) ;
10
+ const copyReturn = await copyTemplate ( config . electron . assets . templateDir , config . electron . platformDir ) ;
11
+ const capConfigName = require ( join ( config . app . rootDir , 'capacitor.config.json' ) ) . appName ;
12
+ const packageJSONParse = require ( join ( config . electron . platformDir , 'package.json' ) ) ;
13
+ packageJSONParse . name = capConfigName ;
14
+ writeFileSync ( join ( config . electron . platformDir , 'package.json' ) , JSON . stringify ( packageJSONParse ) ) ;
15
+ return copyReturn ;
9
16
} ) ;
10
17
11
18
await runTask ( `Installing NPM Dependencies` , async ( ) => {
You can’t perform that action at this time.
0 commit comments