Skip to content

"sketch new ." overwriting sketch without confirmation #1175

Closed
@xax

Description

@xax

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

Activity

ubidefeo

ubidefeo commented on Feb 6, 2021

@ubidefeo

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 :)

added this to the Arduino CLI 1.0 milestone on Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @xax@fstasi@ubidefeo@silvanocerza@per1234

    Issue actions

      "sketch new ." overwriting sketch without confirmation · Issue #1175 · arduino/arduino-cli