1
0
mirror of https://github.com/minio/mc.git synced 2025-11-28 08:03:56 +03:00

Fix Windows config path (#2898)

Remove '.exe' (case insensitive) from executable name for consistent config folder.

Potentially breaking: If people (for whatever reason) used 'mc.exe', this will potentially break their setup.
This commit is contained in:
Klaus Post
2019-10-11 20:37:10 +02:00
committed by kannappanr
parent c389ee4aa0
commit aa4a4774da
5 changed files with 68 additions and 19 deletions

View File

@@ -105,7 +105,10 @@ func Main(args []string) {
// Set the mc app name.
appName := filepath.Base(args[0])
if runtime.GOOS == "windows" && strings.HasSuffix(strings.ToLower(appName), ".exe") {
// Trim ".exe" from Windows executable.
appName = appName[:strings.LastIndex(appName, ".")]
}
// Run the app - exit on error.
if err := registerApp(appName).Run(args); err != nil {
os.Exit(1)