mirror of https://gitee.com/cf-fz/WebCAD.git
parent
62c729e507
commit
3a41e564b1
@ -1,29 +0,0 @@
|
|||||||
import { Factory } from './CADFactory';
|
|
||||||
import { CADObject } from './CADObject';
|
|
||||||
import { CADFiler } from './CADFiler';
|
|
||||||
|
|
||||||
@Factory
|
|
||||||
export class Material extends CADObject
|
|
||||||
{
|
|
||||||
Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//#region -------------------------File-------------------------
|
|
||||||
//对象应该实现dataIn和DataOut的方法,为了对象的序列化和反序列化
|
|
||||||
|
|
||||||
//对象从文件中读取数据,初始化自身
|
|
||||||
ReadFile(file: CADFiler)
|
|
||||||
{
|
|
||||||
super.ReadFile(file);
|
|
||||||
let ver = file.Read();
|
|
||||||
}
|
|
||||||
//对象将自身数据写入到文件.
|
|
||||||
WriteFile(file: CADFiler)
|
|
||||||
{
|
|
||||||
super.WriteFile(file);
|
|
||||||
file.Write(1);
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
}
|
|
@ -1,14 +1,12 @@
|
|||||||
import { getFiles } from "./getFiles";
|
|
||||||
import path = require("path");
|
import path = require("path");
|
||||||
import fs = require("fs");
|
import fs = require("fs");
|
||||||
|
import { getFiles } from "./utils";
|
||||||
|
|
||||||
let dist = path.resolve("./dist");
|
let dist = path.resolve("./dist");
|
||||||
let files = getFiles(dist, []);
|
let files = getFiles(dist, []);
|
||||||
|
|
||||||
files.forEach(f =>
|
for (let f of files)
|
||||||
{
|
{
|
||||||
if (f.indexOf("main.js") !== -1)
|
if (f.indexOf("main.js") !== -1)
|
||||||
fs.unlink(f, e =>
|
fs.unlink(f, e => { });
|
||||||
{
|
}
|
||||||
});
|
|
||||||
})
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
import fs = require("fs");
|
|
||||||
export function getFiles(dir: string, files_: string[])
|
|
||||||
{
|
|
||||||
files_ = files_ || [];
|
|
||||||
let files = fs.readdirSync(dir);
|
|
||||||
for (let i in files)
|
|
||||||
{
|
|
||||||
let name = dir + '/' + files[i];
|
|
||||||
if (fs.statSync(name).isDirectory())
|
|
||||||
getFiles(name, files_);
|
|
||||||
else
|
|
||||||
files_.push(name);
|
|
||||||
}
|
|
||||||
return files_;
|
|
||||||
}
|
|
Loading…
Reference in new issue