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

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

No branches or pull requests

Issue actions