File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import (
22
22
23
23
"github.com/arduino/arduino-cli/cli/errorcodes"
24
24
"github.com/arduino/arduino-cli/cli/feedback"
25
- "github.com/arduino/arduino-cli/cli/globals "
25
+ "github.com/arduino/go-paths-helper "
26
26
"github.com/spf13/cobra"
27
27
)
28
28
@@ -47,13 +47,14 @@ void loop() {
47
47
` )
48
48
49
49
func runNewCommand (cmd * cobra.Command , args []string ) {
50
- sketchDir := globals .Config .SketchbookDir .Join (args [0 ])
50
+ sketchDir := paths .New (args [0 ])
51
+ sketchDir .ToAbs ()
51
52
if err := sketchDir .MkdirAll (); err != nil {
52
53
feedback .Errorf ("Could not create sketch directory: %v" , err )
53
54
os .Exit (errorcodes .ErrGeneric )
54
55
}
55
-
56
- sketchFile := sketchDir .Join (args [ 0 ] + ".ino" )
56
+ sketchName := sketchDir . Base ()
57
+ sketchFile := sketchDir .Join (sketchName + ".ino" )
57
58
if err := sketchFile .WriteFile (emptySketch ); err != nil {
58
59
feedback .Errorf ("Error creating sketch: %v" , err )
59
60
os .Exit (errorcodes .ErrGeneric )
You can’t perform that action at this time.
0 commit comments