-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Core,Cli): Better path-prefix support
Entering non exitsting path-prefix will now result with scaffolder notifying the user about the missing paths and creating them automaticlly Closes #33
- Loading branch information
1 parent
0e807f0
commit 3424e15
Showing
11 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ | |
"packages/*" | ||
], | ||
"version": "independent" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
const baseJestConfig = require('../../jest.base.config.js'); | ||
|
||
module.exports = { | ||
...baseJestConfig | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/scaffolder-cli/tests/e2e/results/prefix/not-existing/not-nested/AWESOME.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/scaffolder-cli/tests/e2e/results/prefix/not-existing/not-nested/context.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
packages/scaffolder-core/src/TemplatesBuilder/createMissingFoldersInPath.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as fs from 'fs'; | ||
|
||
export const createMissingFoldersInPath = (basePath: string, toPath: string) => { | ||
const missingFoldersPaths = []; | ||
if (!toPath) { | ||
return missingFoldersPaths; | ||
} | ||
let currentPath = basePath; | ||
toPath.split('/').forEach((part) => { | ||
currentPath += `/${part}`; | ||
if (!fs.existsSync(currentPath)) { | ||
missingFoldersPaths.push(currentPath); | ||
fs.mkdirSync(currentPath); | ||
} | ||
}); | ||
return missingFoldersPaths; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters