@@ -55,6 +55,7 @@ class NewCommand extends Command
55
55
public $ withoutDependencies ;
56
56
public $ shouldConfigureDatabase = false ;
57
57
public $ ssg ;
58
+ public $ importer ;
58
59
public $ force ;
59
60
public $ baseInstallSuccessful ;
60
61
public $ shouldUpdateCliToVersion = false ;
@@ -83,7 +84,8 @@ protected function configure()
83
84
->addOption ('with-config ' , null , InputOption::VALUE_NONE , 'Optionally copy starter-kit.yaml config for local development ' )
84
85
->addOption ('without-dependencies ' , null , InputOption::VALUE_NONE , 'Optionally install starter kit without dependencies ' )
85
86
->addOption ('pro ' , null , InputOption::VALUE_NONE , 'Enable Statamic Pro for additional features ' )
86
- ->addOption ('ssg ' , null , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY , 'Optionally install the Static Site Generator addon ' , [])
87
+ ->addOption ('ssg ' , null , InputOption::VALUE_OPTIONAL , 'Optionally install the Static Site Generator addon ' , false )
88
+ ->addOption ('importer ' , null , InputOption::VALUE_OPTIONAL , 'Optionally install the Importer addon ' , false )
87
89
->addOption ('git ' , null , InputOption::VALUE_NONE , 'Initialize a Git repository ' )
88
90
->addOption ('branch ' , null , InputOption::VALUE_REQUIRED , 'The branch that should be created for a new repository ' )
89
91
->addOption ('github ' , null , InputOption::VALUE_OPTIONAL , 'Create a new repository on GitHub ' , false )
@@ -135,6 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
135
137
->askToInstallEloquentDriver ()
136
138
->askToEnableStatamicPro ()
137
139
->askToInstallSsg ()
140
+ ->askToInstallImporter ()
138
141
->askToMakeSuperUser ()
139
142
->askToInitializeGitRepository ()
140
143
->askToPushToGithub ()
@@ -146,6 +149,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
146
149
->configureDatabaseConnection ()
147
150
->installEloquentDriver ()
148
151
->installSsg ()
152
+ ->installImporter ()
149
153
->initializeGitRepository ()
150
154
->pushToGithub ()
151
155
->notifyIfOldCliVersion ()
@@ -269,8 +273,9 @@ protected function processArguments()
269
273
$ this ->local = $ this ->input ->getOption ('local ' );
270
274
$ this ->withConfig = $ this ->input ->getOption ('with-config ' );
271
275
$ this ->withoutDependencies = $ this ->input ->getOption ('without-dependencies ' );
272
- $ this ->pro = $ this ->input ->getOption ('pro ' ) ?? true ;
273
- $ this ->ssg = $ this ->input ->getOption ('ssg ' );
276
+ $ this ->pro = $ this ->input ->getOption ('pro ' ) !== false ;
277
+ $ this ->ssg = $ this ->input ->getOption ('ssg ' ) !== false ;
278
+ $ this ->importer = $ this ->input ->getOption ('importer ' ) !== false ;
274
279
$ this ->force = $ this ->input ->getOption ('force ' );
275
280
$ this ->initializeGitRepository = $ this ->input ->getOption ('git ' ) !== false || $ this ->input ->getOption ('github ' ) !== false ;
276
281
$ this ->shouldPushToGithub = $ this ->input ->getOption ('github ' ) !== false ;
@@ -692,6 +697,33 @@ protected function installSsg()
692
697
return $ this ;
693
698
}
694
699
700
+ protected function askToInstallImporter ()
701
+ {
702
+ if ($ this ->importer || ! $ this ->input ->isInteractive ()) {
703
+ return $ this ;
704
+ }
705
+
706
+ if (confirm ('Do you want to install the importer? ' , default: false )) {
707
+ $ this ->importer = true ;
708
+ }
709
+
710
+ return $ this ;
711
+ }
712
+
713
+ protected function installImporter ()
714
+ {
715
+ if (! $ this ->importer ) {
716
+ return $ this ;
717
+ }
718
+
719
+ $ this ->output ->write (PHP_EOL );
720
+ intro ('Installing the Importer addon... ' );
721
+
722
+ $ this ->runCommand ("{$ this ->findComposer ()} require statamic/importer " , workingPath: $ this ->absolutePath );
723
+
724
+ return $ this ;
725
+ }
726
+
695
727
protected function askToMakeSuperUser ()
696
728
{
697
729
if (! $ this ->input ->isInteractive ()) {
0 commit comments