Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
272f583d
Commit
272f583d
authored
Jan 09, 2019
by
Martino Facchin
Committed by
Cristian Maglie
Jan 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recognize if IDE is portable and fix paths accordingly
parent
02ffe3cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
configs/configuration.go
configs/configuration.go
+3
-0
configs/preferences_txt_serializer.go
configs/preferences_txt_serializer.go
+10
-0
No files found.
configs/configuration.go
View file @
272f583d
...
...
@@ -39,6 +39,9 @@ type Configuration struct {
// ArduinoIDEDirectory is the directory of the Arduino IDE if the CLI runs together with it.
ArduinoIDEDirectory
*
paths
.
Path
// IsPortable is set to true if the cli lives in IDE directory and the IDE is portable
IsPortable
bool
// downloadsDir is the directory where the package files are downloaded and cached.
// Use DownloadsDir() method to retrieve it.
downloadsDir
*
paths
.
Path
...
...
configs/preferences_txt_serializer.go
View file @
272f583d
...
...
@@ -62,6 +62,12 @@ func (config *Configuration) IsBundledInDesktopIDE() bool {
}
}
portable
:=
"portable"
if
ideDir
.
Join
(
portable
)
.
Exist
()
{
logrus
.
Info
(
"IDE is portable"
)
config
.
IsPortable
=
true
}
config
.
ArduinoIDEDirectory
=
ideDir
res
=
true
return
true
...
...
@@ -70,6 +76,10 @@ func (config *Configuration) IsBundledInDesktopIDE() bool {
// LoadFromDesktopIDEPreferences loads the config from the Desktop IDE preferences.txt file
func
(
config
*
Configuration
)
LoadFromDesktopIDEPreferences
()
error
{
logrus
.
Info
(
"Unserializing from IDE preferences"
)
if
config
.
IsPortable
{
config
.
DataDir
=
config
.
ArduinoIDEDirectory
.
Join
(
"portable"
)
config
.
SketchbookDir
=
config
.
ArduinoIDEDirectory
.
Join
(
"portable"
)
.
Join
(
"sketchbook"
)
}
preferenceTxtPath
:=
config
.
DataDir
.
Join
(
"preferences.txt"
)
props
,
err
:=
properties
.
LoadFromPath
(
preferenceTxtPath
)
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment