Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add liara init command #200

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ Please check your network connection.`);
throw error;
}
}

async getCurrentAccount(): Promise<IAccount> {
const accounts = (await this.readGlobalConfig()).accounts;
const accName = Object.keys(accounts).find(
Expand Down
16 changes: 2 additions & 14 deletions src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import CreateArchiveException from '../errors/create-archive.js';
import IGetProjectsResponse from '../types/get-project-response.js';
import ReachedMaxSourceSizeError from '../errors/max-source-size.js';
import getPlatformVersion from '../services/get-platform-version.js';
import { promptPort } from '../utils/promptPort.js';

export default class Deploy extends Command {
static description = 'deploy an app';
Expand Down Expand Up @@ -147,7 +148,7 @@ export default class Deploy extends Command {

if (!config.port) {
config.port =
getPort(config.platform) || (await this.promptPort(config.platform));
getPort(config.platform) || (await promptPort(config.platform));
}

this.logKeyValue('App', config.app);
Expand Down Expand Up @@ -765,19 +766,6 @@ Additionally, you can also retry the build with the debug flag:
throw error;
}
}

async promptPort(platform: string): Promise<number> {
const { port } = (await inquirer.prompt({
name: 'port',
type: 'input',
default: getDefaultPort(platform),
message: 'Enter the port your app listens to:',
validate: validatePort,
})) as { port: number };

return port;
}

getMergedConfig(flags: IFlags): IDeploymentConfig {
const defaults = {
path: flags.path ? flags.path : process.cwd(),
Expand Down
Loading