Improvement: When a new file is created if the extension is included (ino or cpp) it will be considerated to create the sketch but wont be included in the folder name
If there is not extension it will check the preference file to generate the new sketch
(Issue: https://github.com/gepd/Deviot/issues/154)
@@ -284,11 +284,19 @@ def create_sketch(sketch_name, select_path):
folder inside of the plugin
"""
from . import paths
+
+ ext = None
+ sketch = sketch_name.split('.')
+ if(len(sketch) > 1):
+ ext = '.' + sketch[-1]
+ sketch_name = sketch_name.replace(ext, '')
+
# file path
sketch_path = path.join(select_path, sketch_name)
if not path.exists(sketch_path):
makedirs(sketch_path)
+ if(not ext):
# use cpp file/template intead of ino
cpp = get_setting('cpp_file', False)
if cpp:
