MCPcopy Create free account
hub / github.com/baiwumm/react-admin / checkDirAndCreate

Function checkDirAndCreate

Xmw_server/src/utils/index.ts:101–111  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

99 * @author: 白雾茫茫丶
100 */
101export const checkDirAndCreate = (filePath: string): void => {
102 const pathArr = filePath.split('/');
103 let checkPath = '.';
104 let item: string;
105 for (item of pathArr) {
106 checkPath += `/${item}`;
107 if (!fs.existsSync(checkPath)) {
108 fs.mkdirSync(checkPath);
109 }
110 }
111};
112
113/**
114 * @description: 获取客户端真实 IP

Callers 1

files.module.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected