Skip to content

Commit 827de41

Browse files
committed
fix: flutter create
1 parent 54da044 commit 827de41

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const main = require('./lib/main').main
33
let dataPath = "test/objc/RuntimeStub.h"
44
let option = {
55
output: 'test/dart',
6-
template: 'package',
6+
template: 'plugin',
77
projectName: 'testPlugin'
88
}
99

lib/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ function formatDartFile(dartPath) {
112112
}
113113

114114
function createFlutterPackage(template, projectName) {
115-
var command = 'flutter create --platforms=android,ios --template=' + template + ' --project-name ' + projectName + ' ' + outputDir
115+
var command = 'flutter create'
116+
if (template == 'plugin') {
117+
command += '--platforms=android,ios --template=' + template
118+
}
119+
command += ' --project-name ' + projectName + ' ' + outputDir
116120
execSync(command, { stdio: 'inherit' })
117121
}
118122

0 commit comments

Comments
 (0)