"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Utils = require("../../util/src");
const FS = require("fs");
const Path = require("path");
var WPT;
(function (WPT) {
    function adapter(path) {
        Utils.FS.walk(path, (root, name, stats) => {
            if (stats.isFile() && name === 'package.json') {
                if (FS.existsSync(Path.join(root, 'Layout_Layout_Cube_Mutil_Projects.rcase'))) {
                    FS.unlinkSync(Path.join(root, 'Layout_Layout_Cube_Mutil_Projects.rcase'));
                }
                if (FS.existsSync(Path.join(root, 'Layer_Layer_Cube_Mutil_Projects.rcase'))) {
                    FS.unlinkSync(Path.join(root, 'Layer_Layer_Cube_Mutil_Projects.rcase'));
                }
                return;
                try {
                    Utils.Console.info(`adapter [${Path.join(root, name)}]`);
                    const pkg = JSON.parse(FS.readFileSync(Path.join(root, name)).toString());
                    const folderName = Utils.FS.lastName(root);
                    // pkg['case'] = {
                    //     id: folderName,
                    //     poles: 'paint_message',
                    //     type: 'vue',
                    //     subtype: 'only_paint_check'
                    // };
                    // pkg['case'] = {
                    //     id: `Layout_${folderName}`,
                    //     poles: 'layout',
                    //     type: 'vue',
                    //     subtype: 'only_paint_check'
                    // };
                    pkg['case'] = {
                        id: `Layer_${folderName}`,
                        poles: 'layer',
                        type: 'vue',
                        subtype: 'only_paint_check'
                    };
                    FS.writeFileSync(Path.join(root, name), JSON.stringify(pkg, undefined, 2));
                }
                catch (error) {
                    Utils.Console.error(`适配异常 : ${error}`);
                }
            }
        });
        return Promise.resolve();
    }
    WPT.adapter = adapter;
})(WPT = exports.WPT || (exports.WPT = {}));
//# sourceMappingURL=wpt.js.map