main: use os.UserCacheDir to get a cache directory
This is more portable than assuming the cache directory lies at ~/.cache.
Этот коммит содержится в:
родитель
9a3d0683b3
коммит
5b0b35f9e4
1 изменённых файлов: 5 добавлений и 3 удалений
|
@ -9,9 +9,11 @@ import (
|
|||
|
||||
// Get the cache directory, usually ~/.cache/tinygo
|
||||
func cacheDir() string {
|
||||
home := getHomeDir()
|
||||
dir := filepath.Join(home, ".cache", "tinygo")
|
||||
return dir
|
||||
dir, err := os.UserCacheDir()
|
||||
if err != nil {
|
||||
panic("could not find cache dir: " + err.Error())
|
||||
}
|
||||
return filepath.Join(dir, "tinygo")
|
||||
}
|
||||
|
||||
// Return the newest timestamp of all the file paths passed in. Used to check
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче