Skip to content

Commit dd07aac

Browse files
authored
Merge pull request #29 from reynaldichernando/fix-close-on-first-login
Fix CLI close unexpectedly when first login
2 parents a47d61c + 6a780cc commit dd07aac

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/commands/shell.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import putility from '@heyputer/putility';
1010

1111
const config = new Conf({ projectName: PROJECT_NAME });
1212

13-
export const rl = readline.createInterface({
14-
input: process.stdin,
15-
output: process.stdout,
16-
prompt: null
17-
});
13+
export let rl;
1814

1915
/**
2016
* Update the current shell prompt
@@ -48,6 +44,12 @@ export async function startShell(command) {
4844
process.exit(0);
4945
}
5046

47+
rl = readline.createInterface({
48+
input: process.stdin,
49+
output: process.stdout,
50+
prompt: null
51+
})
52+
5153
try {
5254
console.log(chalk.green('Welcome to Puter-CLI! Type "help" for available commands.'));
5355
rl.setPrompt(getPrompt());

src/modules/ProfileModule.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class ProfileModule {
4343
if ( ! config.get('selected_profile') ) {
4444
console.log(chalk.cyan('Please login first (or use CTRL+C to exit):'));
4545
await this.switchProfileWizard();
46-
console.log(chalk.red('Please run "puter" command again (issue #11)'));
47-
process.exit(0);
4846
}
4947
this.applyProfileToGlobals();
5048
});

0 commit comments

Comments
 (0)