Skip to content

Commit

Permalink
fix: projectname detection
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Aug 22, 2020
1 parent 7719591 commit c2658b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cli/core/src/abstract-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ export abstract class AbstractCLI {
protected copyAndPrint(folder: string, subfolder = '', options: CreateOps): void {
let projectName = path
.resolve(process.cwd())
.replace(/^([^\/]+\/)+/, '')
.split('')
.reverse()
.join('')
.replace(/(\\|\/).+/g, '')
// .replace(/^([^\/]+\/)+/g, '')
.toLowerCase();

if (options.namespace) {
Expand Down
6 changes: 5 additions & 1 deletion cli/core/src/common-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export class CommonCLI extends AbstractCLI {
(options: CreateOps): string[] => {
let projectName = path
.resolve(process.cwd())
.replace(/^([^\/]+\/)+/, '')
.split('')
.reverse()
.join('')
.replace(/(\\|\/).+/g, '')
// .replace(/^([^\/]+\/)+/g, '')
.toLowerCase();
if (options.namespace) {
projectName = `@${options.namespace}/${projectName}`;
Expand Down

0 comments on commit c2658b3

Please sign in to comment.