mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-21 20:05:12 +08:00
feat: 给rubick 配置一个专门的应用目录
This commit is contained in:
parent
bcfc968c9d
commit
8a536374ea
@ -1,7 +1,14 @@
|
|||||||
|
import path from "path";
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
export default (): string => {
|
export default (): string => {
|
||||||
let localDataFile: any = process.env.HOME;
|
let localDataFile: any = process.env.HOME;
|
||||||
if (!localDataFile) {
|
if (!localDataFile) {
|
||||||
localDataFile = process.env.LOCALAPPDATA;
|
localDataFile = process.env.LOCALAPPDATA;
|
||||||
}
|
}
|
||||||
return localDataFile;
|
const rubickPath = path.join(localDataFile, "rubick")
|
||||||
|
if (!fs.existsSync(rubickPath)) {
|
||||||
|
fs.mkdirSync(rubickPath);
|
||||||
|
}
|
||||||
|
return rubickPath;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user