Merge branch 'master' into image-support

This commit is contained in:
Dolan
2017-03-13 23:37:09 +00:00
7 changed files with 442 additions and 294 deletions

View File

@ -1,5 +1,5 @@
import * as appRoot from "app-root-path";
import * as archiver from "archiver";
import * as path from "path";
import * as xml from "xml";
import { Document } from "../../docx";
import { Numbering } from "../../numbering";
@ -8,6 +8,8 @@ import { Styles } from "../../styles";
import { DefaultStylesFactory } from "../../styles/factory";
import { Formatter } from "../formatter";
const templatePath = path.resolve(__dirname, "../../../template");
export abstract class Packer {
protected archive: any;
private formatter: Formatter;
@ -42,12 +44,12 @@ export abstract class Packer {
this.archive.pipe(output);
this.archive.glob("**", {
expand: true,
cwd: appRoot.path + "/template",
cwd: templatePath,
});
this.archive.glob("**/.rels", {
expand: true,
cwd: appRoot.path + "/template",
cwd: templatePath,
});
const xmlDocument = xml(this.formatter.format(this.document));