More reliable way to check on a clasp install #10
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.
Summary
There have been issues (#5, #9) reported with this generator not properly seeing globally installed versions of
clasp
. The original code actually was trying to pull thepackage.json
of clasp from NODE_PATH, which often times is unreliable -- i.e. the developer could be running nvm, n, etcThis PR changes the way this dependency is checked. It does a straight
execSync('clasp --version')
which should cover the cases above as well as for people who just have one version of Node installed.This will also make the README.md more consistent, as the direction can just be to do an
npm i -g @google/clasp
oryarn add global @google/clasp