Uninstall Template - Hertox82/lt-pm GitHub Wiki

Uninstall Template

this is an example to uninstall a template

import * as path from 'path';
import {PackageManger, Template} from 'lt-pm';

const cwd = path.resolve(__dirname+'/../test/template');      // <- 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 PackageManger(compr,cwd,depl);
//this info passed by third party
const listOfInstalled =[
    new Template('vendor1','nameTemplate','1.0.0')
];

// Passing to PackageManger the list of Installed Plugin
pm.setListTemplateInstalled(listOfInstalled);

// Get the list of avaiable Plugin into the Repo
let listTemplateRepo = pm.getLatestTemplateRepo();

this.listOfInstalled.forEach((tp)=>{
        if(tp.installed){
            pm.uninstallTemplate(tp);
        }
    });
this.listOfInstalled = pm.getListTemplateInstalled();

<< Back