Skip to content

Commit 7797dd0

Browse files
committed
fix: init command
1 parent 8dc6b5c commit 7797dd0

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

packages/prime-cli/src/commands/init.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class InitCommand extends React.Component<Props, State> {
137137
});
138138

139139
installer.on('close', () => {
140-
this.setState({ wizardState: WizardState.DONE }, () => {
140+
this.setState({ wizardState: WizardState.DONE, installMessage: 'Install finished' }, () => {
141141
setTimeout(() => process.exit(), 1000);
142142
});
143143
});
@@ -188,35 +188,40 @@ class InitCommand extends React.Component<Props, State> {
188188
return null;
189189
};
190190

191-
public render() {
191+
public renderDone() {
192192
if (this.state.wizardState === WizardState.DONE) {
193193
return (
194-
<Box marginTop={1} flexDirection="column">
195-
<Box>Installation complete!</Box>
194+
<Box flexDirection="column">
196195
<Box marginTop={1}>To start Prime CMS</Box>
197196
<Box marginTop={1} marginLeft={4} flexDirection="column">
198197
<Box>
199-
<Color green>cd {this.state.projectName}</Color>
198+
<Color green>cd {String(this.state.projectName)}</Color>
200199
</Box>
201200
<Box>
202201
<Color green>yarn start</Color>
203202
</Box>
204203
</Box>
205-
<Box marginTop={1}>
204+
<Box marginTop={1} marginBottom={1}>
206205
Submit issue if you have any problems: https://github.com/birkir/prime/issues
207206
</Box>
208207
</Box>
209208
);
210209
}
210+
return null;
211+
}
211212

212-
if (this.state.wizardState === WizardState.INSTALL) {
213+
public render() {
214+
if (this.state.wizardState >= WizardState.INSTALL) {
213215
return (
214-
<Box marginTop={1}>
215-
<Spinner type="dots12" yellow />
216+
<Box flexDirection="column">
216217
<Box>
217-
{' '}
218-
<Color green>{this.state.installMessage}</Color>
218+
<Spinner type="dots12" yellow={this.state.wizardState === WizardState.INSTALL} />
219+
<Box>
220+
{' '}
221+
<Color green>{this.state.installMessage}</Color>
222+
</Box>
219223
</Box>
224+
{this.renderDone()}
220225
</Box>
221226
);
222227
}

0 commit comments

Comments
 (0)