@@ -37,25 +37,25 @@ type ArduinoApp struct {
3737
3838// Load creates an App instance by reading all the files composing an app and grouping them
3939// by file type.
40- func Load (dir * paths.Path ) (ArduinoApp , error ) {
41- if dir == nil {
40+ func Load (appPath * paths.Path ) (ArduinoApp , error ) {
41+ if appPath == nil {
4242 return ArduinoApp {}, errors .New ("empty app path" )
4343 }
4444
45- exist , err := dir .IsDirCheck ()
45+ exist , err := appPath .IsDirCheck ()
4646 if err != nil {
4747 return ArduinoApp {}, fmt .Errorf ("app path is not valid: %w" , err )
4848 }
4949 if ! exist {
50- return ArduinoApp {}, fmt .Errorf ("app path must be a directory: %s" , dir )
50+ return ArduinoApp {}, fmt .Errorf ("app path must be a directory: %s" , appPath )
5151 }
52- dir , err = dir .Abs ()
52+ appPath , err = appPath .Abs ()
5353 if err != nil {
5454 return ArduinoApp {}, fmt .Errorf ("cannot get absolute path for app: %w" , err )
5555 }
5656
5757 app := ArduinoApp {
58- FullPath : dir ,
58+ FullPath : appPath ,
5959 Descriptor : AppDescriptor {},
6060 }
6161
@@ -70,13 +70,13 @@ func Load(dir *paths.Path) (ArduinoApp, error) {
7070 return ArduinoApp {}, errors .New ("descriptor app.yaml file missing from app" )
7171 }
7272
73- if dir .Join ("python" , "main.py" ).Exist () {
74- app .MainPythonFile = dir .Join ("python" , "main.py" )
73+ if appPath .Join ("python" , "main.py" ).Exist () {
74+ app .MainPythonFile = appPath .Join ("python" , "main.py" )
7575 }
7676
77- if dir .Join ("sketch" , "sketch.ino" ).Exist () {
77+ if appPath .Join ("sketch" , "sketch.ino" ).Exist () {
7878 // TODO: check sketch casing?
79- app .MainSketchPath = dir .Join ("sketch" )
79+ app .MainSketchPath = appPath .Join ("sketch" )
8080 }
8181
8282 if app .MainPythonFile == nil && app .MainSketchPath == nil {
0 commit comments