move pwa manifest to backend
This commit is contained in:
parent
7aa9038a61
commit
b4a7986c8a
16 changed files with 724 additions and 11 deletions
|
@ -20,9 +20,20 @@ export abstract class FileSystemHelper {
|
|||
return readFileSync(this.formatPath(...filePath), "base64");
|
||||
}
|
||||
|
||||
static readRootFile(filePath: string) {
|
||||
return readFileSync(this.normalizePath(process.cwd(), filePath), "utf8");
|
||||
}
|
||||
|
||||
static readTemplateFile(filePath: string) {
|
||||
this.createFolder(filePath);
|
||||
return readFileSync(process.cwd() + filePath, "utf8");
|
||||
return readFileSync(this.normalizePath(process.cwd(), "src", "templates", filePath), "utf8");
|
||||
}
|
||||
|
||||
static readAssetFile(filePath: string, returnPath: boolean = false) {
|
||||
let path = this.normalizePath(process.cwd(), "src", "assets", filePath);
|
||||
if (returnPath) {
|
||||
return path;
|
||||
}
|
||||
return readFileSync(path, "utf8");
|
||||
}
|
||||
|
||||
static writeFile(filePath: string, filename: string, file: any) {
|
||||
|
|
|
@ -9,10 +9,10 @@ export abstract class TemplateHelper {
|
|||
static getTemplateFromFile(template: string) {
|
||||
let tmpFile;
|
||||
try {
|
||||
tmpFile = FileSystemHelper.readTemplateFile(`/src/templates/${template}.template.html`);
|
||||
tmpFile = FileSystemHelper.readTemplateFile(`${template}.template.html`);
|
||||
} catch (err) {
|
||||
tmpFile = FileSystemHelper.readTemplateFile(
|
||||
`/src/templates/${template.split(".")[template.split(".").length - 1]}.template.html`
|
||||
`${template.split(".")[template.split(".").length - 1]}.template.html`
|
||||
);
|
||||
}
|
||||
return tmpFile;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue