-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow clasp open to work for any scriptId #144
Conversation
Adds optional parameter [scriptId] to clasp open command. Signed-off-by: campionfellin <campionfellin@gmail.com>
Pull Request Test Coverage Report for Build 116
💛 - Coveralls |
README.md
Outdated
``` | ||
|
||
Takes an optional argument of the scriptId that you'd like to open. Else, opens script from `.clasp.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First describe what it does without options (90% of cases). Then describe options.
Opens the `clasp` project on script.google.com. Provide a `scriptId` to open a different script.
index.ts
Outdated
if (scriptId) { | ||
openScript(scriptId); | ||
} else { | ||
getProjectSettings().then(async ({ scriptId }: ProjectSettings) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's write this:
getProjectSettings().then(openScript);
const openScript = (scriptId?) => {
if (!scriptId) return;
// if (scriptId.length < 30) { ... length check
// } else { ... log and open
}
In the future (when getProjectSettings
is async):
const openScript = (scriptId?) => { ... }
openScript(scriptId ? scriptId : (await getProjectSettings()).scriptId);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#146 Created issue for async getProjectSettings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking as requesting changes.
Signed-off-by: campionfellin <campionfellin@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adds optional parameter [scriptId] to clasp open command.
Signed-off-by: campionfellin campionfellin@gmail.com
Fixes #100
npm run test
succeeds.npm run lint
succeeds.