This commit is contained in:
parent
6fd3278ee8
commit
af1e69e594
@ -140,6 +140,8 @@ func CPUMemoryStats(applist *[]apps.App, sample int) (*[]apps.App, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getTechAndVersion(symlink string) (*TechInfo, error) {
|
func getTechAndVersion(symlink string) (*TechInfo, error) {
|
||||||
|
symlink = strings.TrimSuffix(symlink, "/bin")
|
||||||
|
|
||||||
link, err := os.Readlink(symlink)
|
link, err := os.Readlink(symlink)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error reading symlink: %w", err)
|
return nil, fmt.Errorf("error reading symlink: %w", err)
|
||||||
|
@ -11,7 +11,7 @@ func TestGetTechAndVersion(t *testing.T) {
|
|||||||
tempDir := t.TempDir()
|
tempDir := t.TempDir()
|
||||||
|
|
||||||
// Create a fake language directory with version in the temporary directory
|
// Create a fake language directory with version in the temporary directory
|
||||||
fakeLangDir := filepath.Join(tempDir, "techs", "python-3.10.4")
|
fakeLangDir := filepath.Join(tempDir, "techs", "python-3.10.4", "bin")
|
||||||
err := os.MkdirAll(fakeLangDir, 0755)
|
err := os.MkdirAll(fakeLangDir, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create fake language directory: %v", err)
|
t.Fatalf("Failed to create fake language directory: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user