in src/profileManager.ts [75:91]
async checkAliyunDir() {
const filePath = path.join(os.homedir(), ".aliyun");
const { R_OK, W_OK } = fs.constants;
try {
// 检测写入权限
await fsx.access(os.homedir(), R_OK | W_OK);
// 检查文件夹是否存在
fs.stat(filePath, async (err) => {
if (err && err.code === "ENOENT") {
// 不存在,创建它
await fs.promises.mkdir(filePath);
}
});
} catch (ex) {
console.error(I18N.src.profileManager.creatFileError, ex);
}
}