forked from mirror/MCSManager
31 lines
706 B
JavaScript
31 lines
706 B
JavaScript
const FileOperate = require("../module/fsoperate").FileOperate;
|
|
|
|
class FileOperateStructure {
|
|
constructor(rootPath = null, cwd = null) {
|
|
this.rootPath = rootPath;
|
|
this.cwd = cwd;
|
|
}
|
|
}
|
|
|
|
|
|
class UseFileOperate {
|
|
constructor(fileOperateStructure) {
|
|
this.fileOperate = new FileOperate(fileOperateStructure.rootPath);
|
|
this.fileOperateStructure = fileOperateStructure;
|
|
}
|
|
|
|
cwd(cwdp) {
|
|
if (cwdp) {
|
|
this.fileOperateStructure.cwd = cwdp;
|
|
return this.fileOperateStructure;
|
|
}
|
|
return this.fileOperateStructure.cwd;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exports.FileOperateStructure = FileOperateStructure;
|
|
exports.UseFileOperate = UseFileOperate; |