Skip to content
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

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

Closed
WilliamRoyNelson opened this issue Oct 10, 2023 · 3 comments

Comments

@WilliamRoyNelson
Copy link
Contributor

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)

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

## Binary Cache

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

mage/mg/runtime.go

Lines 110 to 114 in 9f54e0f

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

	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
Copy link
Contributor Author

Docs fix PR: #484

@mloskot
Copy link

mloskot commented Nov 23, 2023

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
Copy link
Contributor Author

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants