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

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

Closed
everspader opened this issue Jan 7, 2021 · 3 comments

Comments

@everspader
Copy link

(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

  • Node version (node -v): 15.5.1
  • Version (clasp -v): 2.3.0
  • OS (Mac/Linux/Windows): Ubuntu 20.04
@oshliaer
Copy link
Contributor

oshliaer commented Jan 7, 2021

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

Unfortunately only push command has --force argument still.

@PopGoesTheWza
Copy link
Collaborator

@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

@sqrrrl
Copy link
Member

sqrrrl commented Jan 8, 2025

WIll be in next release. Just pushed a fix to avoid writing files unless the project files are fetched.

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