Skip to content
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

Fix clasp login #165

Merged
merged 1 commit into from May 15, 2018
Merged

Fix clasp login #165

merged 1 commit into from May 15, 2018

Conversation

campionfellin
Copy link
Collaborator

Now it checks for local rc file before logging in.

Previously, if you ran clasp login --ownkey followed by clasp login you would have 2 .clasprc.json files, on in your homedir and one in your working directory. Now, it checks for a local rc file first.

Signed-off-by: campionfellin campionfellin@gmail.com

Works on #131 (note, that we may have to implement some sort of check before every command so they do not always default to the rc file in your homedir.)

  • npm run test succeeds. (no tests for login yet)
  • npm run lint succeeds.
  • Appropriate changes to README are included in PR.

Now it checks for local rc file before logging in.

Signed-off-by: campionfellin <campionfellin@gmail.com>
@coveralls
Copy link

coveralls commented May 14, 2018

Pull Request Test Coverage Report for Build 155

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 216 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 14.024%

Files with Coverage Reduction New Missed Lines %
index.js 216 6.55%
Totals Coverage Status
Change from base Build 154: -0.06%
Covered Lines: 159
Relevant Lines: 864

💛 - Coveralls

@grant
Copy link
Contributor

grant commented May 15, 2018

Is this ready?

@campionfellin
Copy link
Collaborator Author

I would say this part is. This prevents you from logging in using simply clasp login when you already have a .clasprc.json in your working directory.

The next step (whether this is a separate PR or on this PR) is to change the behavior of getProjectSettings

export function getProjectSettings(failSilently?: boolean): Promise<ProjectSettings> {

It should check the current directory first for .clasprc.json and if not found then check the homedir.

Once this is done, commands like clasp list, etc should work after using clasp login --ownkey.
Do you think that should be with this or separate?

Copy link
Contributor

@grant grant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the small PR. Small separate changes are good.

@grant grant merged commit 4594a5c into google:master May 15, 2018
@campionfellin campionfellin deleted the login branch May 25, 2018 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants