@@ -96,30 +96,19 @@ const createTizenProject = async() => {
96
96
canSelectMany : false
97
97
} ) ;
98
98
if ( projectPath ) {
99
- const createProject = Cp . execFile ( createPath , [ projectName , projectPath [ 0 ] . path , tizenStudioPath ] ) ;
100
- createProject . stdout . on ( 'data' , createLog => {
101
- console . log ( createLog . toString ( ) ) ;
102
- } ) ;
103
- createProject . stderr . on ( 'data' , errorLog => {
104
- console . log ( errorLog . toString ( ) ) ;
105
- } ) ;
106
- fs . mkdir ( `${ projectPath [ 0 ] . path } /.vscode` , ( err ) => {
107
- if ( err ) {
108
- vscode . window . showErrorMessage ( err . message ) ;
109
- return ;
110
- }
111
- } ) ;
112
- fs . copyFile ( lastModified . filePath , `${ projectPath [ 0 ] . path } /.vscode/launch.json` , ( err ) => {
113
- if ( err ) {
114
- vscode . window . showErrorMessage ( err . message ) ;
115
- return ;
116
- }
117
- } ) ;
118
- vscode . commands . executeCommand ( 'vscode.openFolder' , projectPath [ 0 ] , true ) ;
99
+ Cp . execFileSync ( createPath , [ projectName , projectPath [ 0 ] . path , tizenStudioPath ] ) ;
100
+ openProject ( projectPath [ 0 ] . path , projectName ) ;
119
101
}
120
102
}
121
103
} ;
122
104
105
+ const openProject = ( path : string , name : string ) => {
106
+ const project = vscode . Uri . file ( `${ path } /${ name } ` ) ;
107
+ fs . mkdirSync ( `${ project . path } /.vscode` ) ;
108
+ fs . copyFileSync ( lastModified . filePath , `${ project . path } /.vscode/launch.json` ) ;
109
+ vscode . commands . executeCommand ( 'vscode.openFolder' , project , true ) ;
110
+ } ;
111
+
123
112
const walkSync = ( dir : string , filelist : string [ ] = [ ] ) : string [ ] => {
124
113
fs . readdirSync ( dir ) . forEach ( file => {
125
114
filelist = fs . statSync ( path . join ( dir , file ) ) . isDirectory ( )
0 commit comments