Commit 796d3d89 authored by Cristian Maglie's avatar Cristian Maglie

Removed duplicate ArduinoHomeFolder in configs

parent 0840d03c
......@@ -53,7 +53,7 @@ type BoardMetadata struct {
// NewSketchFromCurrentSketchbook loads a sketch from the sketchbook
func NewSketchFromCurrentSketchbook(name string) (*sketches.Sketch, error) {
sketchbookLocation, err := configs.ArduinoHomeFolder.Get()
sketchbookLocation, err := configs.SketchbookFolder.Get()
if err != nil {
return nil, err
}
......
......@@ -156,7 +156,7 @@ func TestLibDownloadAndInstall(t *testing.T) {
tmpSketchbook, err := paths.MkTempDir("", "test")
require.NoError(t, err, "making temporary staging dir")
defer tmpSketchbook.RemoveAll()
configs.ArduinoHomeFolder.SetPath(tmpSketchbook.String())
configs.SketchbookFolder.SetPath(tmpSketchbook.String())
exitCode, d := executeWithArgs(t, "core", "update-index")
require.Zero(t, exitCode, "exit code")
......
......@@ -61,7 +61,7 @@ void loop() {
`)
func runNewCommand(cmd *cobra.Command, args []string) {
sketchbook, err := configs.ArduinoHomeFolder.Get()
sketchbook, err := configs.SketchbookFolder.Get()
if err != nil {
formatter.PrintError(err, "Cannot get sketchbook folder.")
os.Exit(commands.ErrCoreConfig)
......
......@@ -80,7 +80,7 @@ var syncFlags struct {
func runSyncCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino sketch sync`")
sketchbook, err := configs.ArduinoHomeFolder.Get()
sketchbook, err := configs.SketchbookFolder.Get()
if err != nil {
formatter.PrintError(err, "Cannot get sketchbook folder.")
os.Exit(commands.ErrCoreConfig)
......
......@@ -52,11 +52,8 @@ var ArduinoDataFolder = pathutils.NewPath("Arduino Data", getDefaultArduinoDataF
// SketchbookFolder represents the current root of the sketchbooks tree (defaulted to `$HOME/Arduino`).
var SketchbookFolder = pathutils.NewPath("Sketchbook", getDefaultSketchbookFolder, true)
// TODO: Remove either ArduinoHomeFolder or SketchbookFolder
var ArduinoHomeFolder = SketchbookFolder
// LibrariesFolder is the default folder of downloaded libraries.
var LibrariesFolder = pathutils.NewSubPath("libraries", ArduinoHomeFolder, "libraries", true)
var LibrariesFolder = pathutils.NewSubPath("libraries", SketchbookFolder, "libraries", true)
// PackagesFolder is the default folder of downloaded packages.
var PackagesFolder = pathutils.NewSubPath("packages", ArduinoDataFolder, "packages", true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment