Add new e2e command

This commit is contained in:
Dolan
2019-01-15 00:23:01 +00:00
parent d19cdcae0c
commit b37d2c141d
7 changed files with 42 additions and 9 deletions

View File

@ -0,0 +1,20 @@
import * as glob from "glob";
import * as replace from "replace-in-file";
const files = glob.sync("build/**/*.d.ts");
for (const file of files) {
replace({
files: file,
from: /"file[a-z/-]*"/gi,
to: (match) => {
const matchSlug = match.replace(/['"]+/g, "").trim();
const levelCount = file.split("/").length - 2;
const backLevels = Array(levelCount)
.fill("../")
.join("");
return `"${backLevels}${matchSlug}"`;
},
});
}