feat: support windows (#122)

This commit is contained in:
jdx 2024-09-25 16:27:52 -05:00 committed by GitHub
parent bd6a003a27
commit 5d3e058edf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 3835 additions and 3537 deletions

View file

@ -6,9 +6,11 @@ export function miseDir(): string {
const dir = core.getState('MISE_DIR')
if (dir) return dir
const { MISE_DATA_DIR, XDG_DATA_HOME } = process.env
const { MISE_DATA_DIR, XDG_DATA_HOME, LOCALAPPDATA } = process.env
if (MISE_DATA_DIR) return MISE_DATA_DIR
if (XDG_DATA_HOME) return path.join(XDG_DATA_HOME, 'mise')
if (process.platform === 'win32' && LOCALAPPDATA)
return path.join(LOCALAPPDATA, 'mise')
return path.join(os.homedir(), '.local/share/mise')
return path.join(os.homedir(), '.local', 'share', 'mise')
}