google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.59k stars 428 forks source link

clasp run doesn't use ~/.clasprc.json and requires .clasprc.json in local directory #916

Open maisondelamitie opened 2 years ago

maisondelamitie commented 2 years ago

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

Use ~/.clasprc.json by default

Actual Behavior

Error message when running clasp run: (ENOENT) Error: ENOENT: no such file or directory, open '[localdir]/.clasprc.json'

Steps to Reproduce the Problem

  1. authenticate clasp, resulting in a ~/.clasprc.json file
  2. from some random directory, clone a project using clasp clone
  3. in that same directory, run clasp run function
  4. clasp does connect to console.developers.google.com but then looks for a local .clasprc.json and fails.
  5. note that specifying the path to the ~/.clasprc.json file doesn't work either. Specifying only -A ~ results in authentication failing ("Could not read API credentials. Are you logged in globally?")

Specifications