"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const helpers_1 = require("../../utils/helpers");
const updatePackageJson_1 = tslib_1.__importDefault(require("../createProject/updatePackageJson"));
const copyProjectScript = async (integration, targetPath, projectName) => {
    const resolvedTargetPath = path_1.default.resolve(__dirname, `../../../templates/${integration}`);
    await helpers_1.copyThemeFiles(resolvedTargetPath, path_1.default.isAbsolute(targetPath)
        ? targetPath
        : path_1.default.join(__dirname, targetPath), resolvedTargetPath);
    const absoluteTargetPath = path_1.default.isAbsolute(targetPath)
        ? targetPath
        : path_1.default.join(__dirname, targetPath);
    const packageJsonPath = path_1.default.join(absoluteTargetPath, 'package.json');
    await updatePackageJson_1.default(packageJsonPath, projectName);
};
exports.default = copyProjectScript;
//# sourceMappingURL=index.js.map