Skip to content

fix: sketch Save As #2292

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

Merged
merged 2 commits into from
Jan 15, 2024
Merged

fix: sketch Save As #2292

merged 2 commits into from
Jan 15, 2024

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Nov 23, 2023

Motivation

This PR rewrites how the sketch copy logic works under the hood when saving a sketch with a different name (via Save As):

  • Fixes subfolder structure corruptions by copying the sketch into a temporary location first, then to the desired destination.
  • Prevents data loss when a collision occurs between the target primary source file name and existing secondary source files of the sketch.

Change description

Other information

This PR drops cpy.
Ref: sindresorhus/cpy@47b89a7

Closes #2077
Closes #827

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Nov 23, 2023
@kittaakos kittaakos requested a review from per1234 November 23, 2023 16:54
@kittaakos kittaakos marked this pull request as ready for review November 23, 2023 16:54
Akos Kitta added 2 commits November 24, 2023 10:16
This commit rewrites how IDE copies sketches as part of the _Save As_
operation. Instead of copying to the destination, IDE copies the sketch
into a temporary location, then to the desired destination.

This commit drops [`cpy`](https://www.npmjs.com/package/cpy).
Ref: sindresorhus/cpy@47b89a7

Closes #2077

Signed-off-by: Akos Kitta <[email protected]>
The Save As operation is halted and the problem clearly communicated to
the user when there is a collision between the target primary source
file name and existing secondary source files of the sketch.

Closes #827

Signed-off-by: Akos Kitta <[email protected]>
Copy link
Contributor

@davegarthsimpson davegarthsimpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any issues, left a minor question, nice!

@kittaakos kittaakos merged commit d01f956 into main Jan 15, 2024
@kittaakos kittaakos deleted the #2077 branch January 15, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
2 participants