Packing Template - Hertox82/lt-pm GitHub Wiki
Packing Template
this is an example to packing a template
import * as path from 'path';
import {PackageManager, Template} from 'lt-pm';
const cwd = path.resolve(__dirname+'/../test/plugins'); // <- Folder to take the Template Source
const compr = path.resolve(__dirname+'/../test/compressed'); // <- Folder to put Compressed template
const depl = path.resolve(__dirname+'/../test/toDeploy'); // <- Folder to Decompress template
const pm = new PackageManager(compr,cwd,depl);
//this info passed by third party
const listOfInstalled =[
new Template('nameTemplate','vendor1','1.0.0')
];
// Passing to PackageManager the list of Installed Plugin
pm.setListTemplateInstalled(listOfInstalled);
// Get the list of avaiable Template into the Repo
let listTemplateRepo = pm.getLatestTemplateRepo();
let listOfInstalled = pm.getListTemplateInstalled();
listOfInstalled.forEach((temp) => {
if(!temp.packed) {
pm.packageTemplate(temp);
}
});