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

Avoid creating .clasp.json when a clone fails or overwrite the file every time #824

Open everspader opened 3 years ago

everspader commented 3 years ago

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

Expected Behavior

DO NOT create a .clasp.json file when a clasp clone command fails for some reason, for example, invalid ScriptID or login. This means that if the issue is fixed, and the clone is run again, it will fail because there's already a .clasp.json file in the directory.

Actual Behavior

A .clasp.json file is created whenever a clasp clone command is run regardless of the success or failure of the output.

Steps to Reproduce the Problem

  1. clasp login to any account
  2. clasp clone with a wrong ScriptID
  3. Fix the ScriptID
  4. clasp clone with the correct ScriptID

Specifications

oshliaer commented 3 years ago

I think overwriting the file as a common task would be fine too.

Unfortunately only push command has --force argument still.

PopGoesTheWza commented 3 years ago

@everspader Just to be sure the issue still exist, can you try replacing @google/clasp 2.3.0 with forked-clasp which is more advanced?

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