• MatteoPologruto's avatar
    Fix `sketch new` default overwriting behavior (#1993) · ab73719d
    MatteoPologruto authored
    * Check .ino sketch file exists in path before creating a new one
    
    Running "arduino-cli sketch new ." from a sketch directory overwrites an existing .ino sketch file, without asking for confirmation. This fix introduces a check to verify if the specified path already
    contains a .ino sketch file. If it does, an error is returned, otherwise a new sketch is created as usual.
    
    * Add test to check if sketch new does not overwrite an already existing .ino sketch file
    
    * Add --overwrite flag to sketch new command
    
    Using the "--overwrite" flag, allows to create a new sketch overwriting an existing one.
    ab73719d
commands.proto 9.88 KB