magefile / mage

a Make/rake-like dev tool using Go
https://magefile.org
Apache License 2.0
4.01k stars 250 forks source link

Documentation for MAGEFILE_CACHE is not consistent with actual behavior on Windows #483

Closed WilliamRoyNelson closed 7 months ago

WilliamRoyNelson commented 8 months ago

https://github.com/magefile/mage/blob/master/site/content/environment/_index.en.md?plain=1#L14-L17

## MAGEFILE_CACHE

Sets the directory where mage will store binaries compiled from magefiles
(default is $HOME/.magefile)

https://github.com/magefile/mage/blob/9f54e0f83e2a8d2976c07037ad74aa20c62797a5/site/content/howitworks/_index.en.md?plain=1#L15-L18

## Binary Cache

Compiled magefile binaries are stored in $HOME/.magefile.  This location can be
customized by setting the MAGEFILE_CACHE environment variable.

https://github.com/magefile/mage/blob/9f54e0f83e2a8d2976c07037ad74aa20c62797a5/mg/runtime.go#L110-L114

    switch runtime.GOOS {
    case "windows":
        return filepath.Join(os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"), "magefile")
    default:
        return filepath.Join(os.Getenv("HOME"), ".magefile")

On Windows, instead of creating a folder at %USERPROFILE%\.magefile as would be expected by the documentation, a folder is created at %USERPROFILE%\magefile

WilliamRoyNelson commented 8 months ago

Docs fix PR: https://github.com/magefile/mage/pull/484

mloskot commented 7 months ago

This can be closed since

has been merged by @natefinch

@WilliamRoyNelson It is a good idea to use the GitHub features of Closing Issues via Commit Messages next time, so related issues are not left dangling after merge.

WilliamRoyNelson commented 7 months ago

This can be closed since

  • 484

has been merged by @natefinch

@WilliamRoyNelson It is a good idea to use the GitHub features of Closing Issues via Commit Messages next time, so related issues are not left dangling after merge.

That is an awesome feature that I was not aware of. I will make sure to do that in the future!