fix: Unable to create project from local path of template v2 #3793
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.
pacote
package does not work very well with relative paths, so ensure we pass full path to theextractPackage
method. When trying to pass.tgz
with relative path for template and the.tgz
is located next to.git
dir, thepacote
package tries to download the repository instead of using the local .tgz package. Once full path is passed, it works correctly.PR Checklist
What is the current behavior?
Follow the steps below and you'll receive an error:
git clone https://github.com/rosen-vladimirov/test-tns-template-v2
cd test-tns-template-v2 && npm pack && cd ..
- this will produce atest-tns-template-v2.tgz
intest-tns-template-v2
dir.test-tns-template-v2
) try to create a new project by passing relative path to the .tgz:tns create myApp --template test-tns-template-v2/test-tns-template-v2.tgz
The last operation will fail with error:
What is the new behavior?
You can successfully create a project with the steps above