diff --git a/packages/cli/src/commands/project/create-project.ts b/packages/cli/src/commands/project/create-project.ts index 1b8331f7b5..b679e69943 100644 --- a/packages/cli/src/commands/project/create-project.ts +++ b/packages/cli/src/commands/project/create-project.ts @@ -45,7 +45,8 @@ export default class Create_project extends Command { ROOT_API_URL_PROD ).catch((e) => this.error(e)); + const [account, name] = result.key.split('/'); this.log(`Successfully created project: ${result.key} - \nProject Url: ${BASE_PROJECT_URL}/project/${result.key}`); + \nProject Url: ${BASE_PROJECT_URL}/orgs/${account}/projects/${name}/deployments`); } } diff --git a/packages/cli/src/commands/project/index.ts b/packages/cli/src/commands/project/index.ts index efc26f3510..3ee7df3f06 100644 --- a/packages/cli/src/commands/project/index.ts +++ b/packages/cli/src/commands/project/index.ts @@ -45,7 +45,7 @@ export default class Project extends Command { const handler = Project.optionMapping[userOptions]; // removes arguments -> deployment and everything before it from the process.argv const stripped_argv: string[] = process.argv - .filter((v, idx) => idx > process.argv.indexOf('deployment') && !v.includes('--options')) + .filter((v, idx) => idx > process.argv.indexOf('project') && !v.includes('--options')) .reduce((acc, val) => acc.concat(val.split('=')), []); await handler.run(stripped_argv); diff --git a/packages/cli/src/controller/project-controller.ts b/packages/cli/src/controller/project-controller.ts index 2aa79c28b7..5eac29553f 100644 --- a/packages/cli/src/controller/project-controller.ts +++ b/packages/cli/src/controller/project-controller.ts @@ -7,6 +7,12 @@ import {errorHandle} from '../utils'; interface createProjectType { key: string; } +export const suffixFormat = (value: string) => { + return value + .replace(/(^\s*)|(\s*$)/g, '') + .replace(/\s+/g, '-') + .toLowerCase(); +}; export async function createProject( organization: string, subtitle: string, @@ -31,7 +37,7 @@ export async function createProject( apiVersion: `v${apiVersion}`, description: description, gitRepository: gitRepository, - key: `${organization}/${project_name}`, + key: `${organization}/${suffixFormat(project_name)}`, logoUrl: logoUrl, name: project_name, subtitle: subtitle,