-
Notifications
You must be signed in to change notification settings - Fork 1
fix(jh): honour JULIA_DEPOT_PATH rather than .julia
#16
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,14 +8,27 @@ import ( | |
| ) | ||
|
|
||
| func createJuliaAuthFile(server string, token *StoredToken) error { | ||
| // Get user home directory | ||
| homeDir, err := os.UserHomeDir() | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get user home directory: %w", err) | ||
| // Determine Julia depot path | ||
| var depotPath string | ||
| if juliaDepot := os.Getenv("JULIA_DEPOT_PATH"); juliaDepot != "" { | ||
| // Use first path from JULIA_DEPOT_PATH (paths are separated by : on Unix, ; on Windows) | ||
| depotPaths := filepath.SplitList(juliaDepot) | ||
| if len(depotPaths) > 0 { | ||
| depotPath = depotPaths[0] | ||
| } | ||
| } | ||
|
|
||
| // Fall back to ~/.julia if JULIA_DEPOT_PATH is not set | ||
| if depotPath == "" { | ||
| homeDir, err := os.UserHomeDir() | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get user home directory: %w", err) | ||
| } | ||
| depotPath = filepath.Join(homeDir, ".julia") | ||
|
||
| } | ||
|
|
||
| // Create ~/.julia/servers/{server}/ directory | ||
| serverDir := filepath.Join(homeDir, ".julia", "servers", server) | ||
| // Create {depot}/servers/{server}/ directory | ||
| serverDir := filepath.Join(depotPath, "servers", server) | ||
| if err := os.MkdirAll(serverDir, 0755); err != nil { | ||
| return fmt.Errorf("failed to create server directory: %w", err) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Maybe its simpler rely on Base.DEPOT_PATH?. Oops, Didnt realize this was go