no hard code loc

This commit is contained in:
HolographicHat
2022-04-07 20:13:42 +08:00
parent 01ab053d7d
commit 0e51e080d4
2 changed files with 2 additions and 3 deletions

View File

@@ -241,7 +241,7 @@ let hostsContent = undefined
const setupHost = (restore = false) => {
if (restore && hostsContent === undefined) return
const path = "C:\\Windows\\System32\\drivers\\etc\\hosts"
const path = `${process.env.windir}\\System32\\drivers\\etc\\hosts`
if (!fs.existsSync(path)) {
fs.writeFileSync(path, "")
}