google / clasp

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

clasp generates .clasp.json under the 'rootDir' folder #923

Closed lushu closed 2 years ago

lushu commented 2 years ago

We have a solution based on Cloud Functions and Google Sheet (AppsScript). Under the solution root folder, there is a folder named 'apps_script' which contains js files and appscript.json that will be pushed to the newly created Google Sheet(Script) during the installation. There are other folders for other parts, e.g. Cloud Functions, etc.

We use clasp to help user create a new Google Sheet and push the codes into it.

Expected Behavior

We use following cmd to create a new project: clasp create --type sheets --title 'test' --rootDir ./apps_script The .clasp.json should be generated under the solution root folder, so the following clasp push can pick up the config and do the work.

Actual Behavior

The .clasp.json was generated under the folder apps_script, then the next cmd clasp push failed due to there is no valid .clasp.json project file. There is no way to guide clasp push to know where is the .clasp.json. I am pretty sure that it was the case before. It also says in the README:

When running clone or create, a file named .clasp.json is created in the current directory to describe clasp's configuration for the current project.

Steps to Reproduce the Problem

  1. As described.

Specifications

mark05e commented 2 years ago

Refer to this solution https://github.com/google/clasp/issues/869#issuecomment-899759886

Use the -P switch

lushu commented 2 years ago

Thank you.