|
|
@@ -9,7 +9,7 @@ const path = require('path');
|
|
|
const util = require('./util');
|
|
|
const platform = process.platform;
|
|
|
const sys_host_path = platform == 'win32' ?
|
|
|
- 'C:\\WINDOWS\\system32\\drivers\\etc\\hosts' : // todo 处理系统没有安装在 C 盘的情况
|
|
|
+ `${process.env.windir}\\system32\\drivers\\etc\\hosts` : // Windows 系统有可能不安装在 C 盘
|
|
|
'/etc/hosts';
|
|
|
const home_path = util.getUserHome();
|
|
|
const work_path = path.join(home_path, '.SwitchHosts');
|