@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
17 lines (16 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GithubPublishSpecService = void 0;
const file_system_utils_1 = require("../../../../utils/file-system-utils");
const generate_file_1 = require("../../generate-file");
class GithubPublishSpecService extends generate_file_1.GenerateFileTemplate {
create(branchName, writeFilePath) {
const template = file_system_utils_1.FileSystemUtils.buildPath(generate_file_1.GenerateFileTemplate.templatesFolder, "spec", "github", "publish-spec.yaml.mustache");
const params = { "branch-name": branchName };
const worflowPath = file_system_utils_1.FileSystemUtils.buildPath(writeFilePath, ".github", "workflows");
if (!file_system_utils_1.FileSystemUtils.exists(worflowPath))
file_system_utils_1.FileSystemUtils.createFolder(worflowPath);
super.writeFile(file_system_utils_1.FileSystemUtils.buildPath(worflowPath, `publish-spec-${branchName}.yaml`), template, params);
}
}
exports.GithubPublishSpecService = GithubPublishSpecService;