This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
feat: Link new and migrate command with the init functionality #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
This PR links the functionality of the new and migrate commands with the init command to allow both steps to be done in one command. The first step of this work was refactoring the bulk of the initialisation logic into a new class in the
utils/init.ts
file. An--init
flag was then added to both thenew
andmigrate
command. If this flag is passed in then thecdk
project directory is created before the rest of the command is executed.How to test
Try running the
new
andmigrate
commands both with and without the--init
flag appended to see the project directory being created.How can we measure success?
Users don't have to run the
init
command followed by either thenew
ormigrate
commands when starting a new cdk project.Have we considered potential risks?
There is some risk when running commands that interact with the filesystem but validation has been added to check if files and directories already exist before taking any action.