Skip to content

Commit 0328828

Browse files
committed
Refactored installer prompts into decoupled handlers.
1 parent 6c1e373 commit 0328828

35 files changed

Lines changed: 1778 additions & 499 deletions

.vortex/installer/composer.lock

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vortex/installer/src/Command/InstallCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
102102

103103
static::header();
104104

105-
$pm->prompt();
105+
$pm->runPrompts();
106106

107107
Tui::list($pm->getResponsesSummary(), 'Installation summary');
108108

@@ -116,36 +116,36 @@ protected function execute(InputInterface $input, OutputInterface $output): int
116116

117117
Tui::action(
118118
label: '⬇️ Downloading Vortex',
119-
hint: fn(): string => sprintf('Downloading from "%s" repository at commit "%s"', ...Downloader::parseUri($this->config->get(Config::REPO))),
120-
success: 'Vortex downloaded',
121119
action: function (): void {
122120
$version = (new Downloader())->download($this->config->get(Config::REPO), $this->config->get(Config::REF), $this->config->get(Config::TMP));
123121
$this->config->set(Config::VERSION, $version);
124122
},
123+
hint: fn(): string => sprintf('Downloading from "%s" repository at commit "%s"', ...Downloader::parseUri($this->config->get(Config::REPO))),
124+
success: 'Vortex downloaded',
125125
);
126126

127127
Tui::action(
128128
label: '⚙️ Customizing Vortex for your project',
129+
action: fn() => $pm->runProcessors(),
129130
success: 'Vortex was customized for your project',
130-
action: fn() => $pm->process(),
131131
);
132132

133133
Tui::action(
134134
label: '🥣 Preparing destination directory',
135-
success: 'Destination directory is ready',
136135
action: fn(): array => $this->prepareDestination(),
136+
success: 'Destination directory is ready',
137137
);
138138

139139
Tui::action(
140140
label: '➡️ Copying files to the destination directory',
141-
success: 'Files copied to destination directory',
142141
action: fn() => $this->copyFiles(),
142+
success: 'Files copied to destination directory',
143143
);
144144

145145
Tui::action(
146146
label: '🎬 Preparing demo content',
147-
success: 'Demo content prepared',
148147
action: fn(): string|array => $this->handleDemo(),
148+
success: 'Demo content prepared',
149149
);
150150

151151
// @todo Implement the demo mode.

0 commit comments

Comments
 (0)