forked from mirror/MCSM-Daemon
Feat: add filename check
This commit is contained in:
parent
dba205eefb
commit
cc733311ce
@ -110,6 +110,8 @@ export default class FileManager {
|
||||
}
|
||||
|
||||
async newFile(fileName: string) {
|
||||
if (!FileManager.checkFileName(fileName)) throw new Error(ERROR_MSG_01);
|
||||
if (!this.checkPath(fileName)) throw new Error(ERROR_MSG_01);
|
||||
const target = this.toAbsolutePath(fileName);
|
||||
fs.createFile(target);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user