-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set only one env variable for the Toit repository. #154
Conversation
If the `JAG_TOIT_REPO_PATH` is set, we - Find and build the SDK in it. - Use the IDF from that Toit repository. - Assume that we are in development mode, and thus find the jaguar.snapshot relative to the jag executable. Also, the Makefile was modified, to only use `?=` for variables that we want to influence with environment variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
cmd/jag/directory/directory.go
Outdated
@@ -106,9 +118,9 @@ func GetESP32ImageCachePath() (string, error) { | |||
} | |||
|
|||
func GetESP32ImagePath() (string, error) { | |||
imagePath, ok := os.LookupEnv(Esp32ImageEnv) | |||
toit_repo_path, ok := os.LookupEnv(ToitRepoPathEnv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toitRepoPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
cmd/jag/directory/directory.go
Outdated
@@ -89,6 +86,21 @@ func GetSnapshotsCachePath() (string, error) { | |||
return ensureDirectory(filepath.Join(home, ".cache", "jaguar", "snapshots"), nil) | |||
} | |||
|
|||
func GetSDKPath() (string, error) { | |||
toit_repo_path, ok := os.LookupEnv(ToitRepoPathEnv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toitRepoPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
cmd/jag/directory/directory.go
Outdated
@@ -122,6 +134,18 @@ func GetESP32ImagePath() (string, error) { | |||
} | |||
|
|||
func GetJaguarSnapshotPath() (string, error) { | |||
_, ok := os.LookupEnv(ToitRepoPathEnv) | |||
if ok { | |||
// We assume that the jaguar executable is inside the build directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminate comment with .
jaguar -> jag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
cmd/jag/directory/directory.go
Outdated
_, ok := os.LookupEnv(ToitRepoPathEnv) | ||
if ok { | ||
// We assume that the jaguar executable is inside the build directory | ||
// of the Jag repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jag -> Jaguar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
cmd/jag/directory/directory.go
Outdated
@@ -143,9 +167,9 @@ func GetEsptoolCachePath() (string, error) { | |||
} | |||
|
|||
func GetEsptoolPath() (string, error) { | |||
esptoolPath, ok := os.LookupEnv(EsptoolPathEnv) | |||
toit_repo_path, ok := os.LookupEnv(ToitRepoPathEnv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toitRepoPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
If the
JAG_TOIT_REPO_PATH
is set, wethe jaguar.snapshot relative to the jag executable.
Also, the Makefile was modified, to only use
?=
for variables that wewant to influence with environment variables.