Skip to content

"sketch new ." overwriting sketch without confirmation #1175

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

Closed
xax opened this issue Feb 6, 2021 · 1 comment · Fixed by #1993
Closed

"sketch new ." overwriting sketch without confirmation #1175

xax opened this issue Feb 6, 2021 · 1 comment · Fixed by #1993
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@xax
Copy link

xax commented Feb 6, 2021

Bug Report

Current behavior

Running arduino-cli sketch new . (← note the dot) from a sketch directory overwrites an existing .inosketch file without asking for confirmation, sketch folder (by accident or not) indeed not empty.

Consider for example the following situation (noted bash-like, though see system used below):

$ ls -R
.:
sketch_foo

./sketch_foo:
sketch_foo.ino
$
$ cd sketch_foo
$ arduino-cli sketch new .
$ # sketch_foo.ino will be overwritten with template boilerplate

Expected behavior

The command should not be destructive like that by default. fletch new should not overwrite anything; probably a flag forcing to overwrite may be useful.

Environment

  • CLI version (output of arduino-cli version):
    arduino-cli alpha Version: 0.15.1 Commit: c7403ed Date: 2021-02-04T10:11:39Z
  • OS and platform:
    Windows 10 [Version 10.0.19042.789], x64
@ubidefeo
Copy link

ubidefeo commented Feb 6, 2021

thank you for this one, @xax

I think it's a regression we introduced recently because I can't remember having this issues (I always use the same sketch name when I test things around in my home folder).

@silvanocerza I have assigned this to you.
@rsora highest priority, please :)

@per1234 per1234 reopened this Mar 30, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@umbynos umbynos added this to the Arduino CLI 1.0 milestone Nov 28, 2022
@umbynos umbynos added the topic: code Related to content of the project itself label Nov 28, 2022
@umbynos umbynos linked a pull request Nov 29, 2022 that will close this issue
5 tasks
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
Development

Successfully merging a pull request may close this issue.

8 participants