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

[fork] Introducing forked @google/clasp #24

Closed
PopGoesTheWza opened this issue Jan 13, 2020 · 8 comments
Closed

[fork] Introducing forked @google/clasp #24

PopGoesTheWza opened this issue Jan 13, 2020 · 8 comments

Comments

@PopGoesTheWza
Copy link
Owner

PopGoesTheWza commented Jan 13, 2020

Forked @google/clasp

Following discussion with @khalilchoudhry on google#12 from official @google/clasp repository, I started this forked branch.

Changes

It currently includes pending PRs

PR Scope Content
google#688 enhancement Support for environment varaible and CLI options to specify configuration files (potentially solves issues google#12, google#42, google#483 and google#524)
google#721 bug fix Enhanced Windows support which attempts to solve google#717
google#702 doc Instruction to use local @google/clasp install
google#708 doc Update about scriptId of Project Settings File by @kenchan0130
google#724 doc Instruction using gitpod by @takanakahiko
google#713 chore Update dependencies

Pending

The following PR has not (yet) been included. Feedback on it will motivate me to integrate it.

google#715 | enhancement | Add --account <account> flag to clasp open by @maxmclau to solve google#709

Testing the fork

Download this forked branch and build with the command:

npm uninstall -g @google/clasp && npm install && npm audit fix && npm run build

The environment variables clasp_config_project, clasp_config_ignore and clasp_config_auth can the be used to reference config files.

The (temporary) command clasp paths can help you check how config files are resolved.

$ clasp paths
project .clasp.json true .clasp.json
ignore /Users/guillaumec/.claspignore true .claspignore
auth /Users/guillaumec/.clasprc.json true /Users/guillaumec/.clasprc.json
$ clasp paths -A ~/customAuth.json -I ./dev-conf -P ./dev-conf
project ./dev-conf false ./dev-conf
ignore ./dev-conf false ./dev-conf
auth /Users/guillaumec/customAuth.json false /Users/guillaumec/customAuth.json

The clasp --help command should now display new options to reference config files:

$ clasp --help
Usage: clasp <command> [options]

clasp - The Apps Script CLI

Options:
  -A, --auth <file>                           path to an auth file or a folder with a '.clasprc.json' file.
  -I, --ignore <file>                         path to an ignore file or a folder with a '.claspignore' file.
  -P, --project <file>                        path to a project file or to a folder with a '.clasp.json' file.
  -v, --version
  -h, --help                                  output usage information

[...]

A drafted doc is here under /doc

@khalilchoudhry
Copy link

@PopGoesTheWza Config variables work. I have tried pushing with different files like .clasp.dev.json and others with cli and environment variables.
Can you explain a bit about -A flag. I don't know why but I removed the global clasprc.json and moved it under the local project. Then I used 'clasp login --status -A .clasprc.json' and it says 'You are not logged in' but if I run 'clasp push -A .clasprc.json', it successfully pushes the build. Are they allowed to run together or do I have to have a separate global clasprc.json too?

@PopGoesTheWza
Copy link
Owner Author

@khalilchoudhry Thanks for the feedback. The quick fork helped you somehow then.

I will try to take the time to make a proper PR within the official repo later.

Doing so, I will investigate how the authentication config is handled.

@khalilchoudhry
Copy link

@PopGoesTheWza hey, any update about PR on clasp official repo?

@PopGoesTheWza
Copy link
Owner Author

Too much on my plate at this moment. I hope for some latitude in the next month.

@khalilchoudhry
Copy link

Hi, I hope you are doing good. I needed to confirm if this has been merged into the original repo yet?

@NoSubstitute
Copy link

I think both this and #42 has had no change due to Covid19.
Would be nice there was some action on either, as I also use several different accounts to manage GAS projects.

@oshliaer
Copy link

  • Will this project be supported in the future?
  • Is there insurmountable difficulty to use it instead of @ google/clasp?

@PopGoesTheWza
Copy link
Owner Author

@contributorpw I will maintain this fork as well as the original repo.
Only this repo will be available as npm package. forked-clasp is a drop-in replacement to @google/clasp

npm uninstall -g @google/clasp
npm install -g forked-clasp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants