function uninstallHelper()

in lib/plugman/pluginHandlers.js [282:306]


function uninstallHelper (type, obj, project_dir, plugin_id, options, project) {
    const targetDir = path.resolve(project.plugins_dir, plugin_id, obj.targetDir || '');
    const destFile = path.join(targetDir, path.basename(obj.src));

    let project_ref;
    const link = !!(options && options.link);
    if (link) {
        const trueSrc = fs.readlinkSync(destFile);
        project_ref = `Plugins/${fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc))}`;
    } else {
        project_ref = `Plugins/${fixPathSep(path.relative(project.plugins_dir, destFile))}`;
    }

    fs.rmSync(targetDir, { recursive: true, force: true });

    if (type === 'header-file') {
        project.xcode.removeHeaderFile(project_ref);
    } else if (obj.framework) {
        const project_relative = path.join(path.basename(project.xcode_path), project_ref);
        project.xcode.removeFramework(project_relative);
        project.xcode.removeFromLibrarySearchPaths({ path: project_ref });
    } else {
        project.xcode.removeSourceFile(project_ref);
    }
}