@softwareventures/maintain-project
Version:
Automatically create and maintain TypeScript projects with standard settings for Software Ventures Limited
30 lines • 1.7 kB
JavaScript
import { insert } from "../fs-stage/fs-stage.js";
import { chainAsyncResultsFn, success } from "../result/result.js";
import { copyFromTemplate } from "../template/copy.js";
import { projectTemplateId } from "../template/project-template-id.js";
export function writeIdeaRunConfigurations(project) {
return chainAsyncResultsFn([
writeIdeaRunConfigurationFix(project),
writeIdeaRunConfigurationLint(project),
writeIdeaRunConfigurationTest(project),
writeIdeaRunConfigurationStart(project)
]);
}
export function writeIdeaRunConfigurationFix(project) {
return async (fsStage) => copyFromTemplate(projectTemplateId(project), ".idea", "runConfigurations", "fix.xml").then(file => insert(fsStage, ".idea/runConfigurations/fix.xml", file));
}
export function writeIdeaRunConfigurationLint(project) {
return async (fsStage) => copyFromTemplate(projectTemplateId(project), ".idea", "runConfigurations", "lint.xml").then(file => insert(fsStage, ".idea/runConfigurations/lint.xml", file));
}
export function writeIdeaRunConfigurationTest(project) {
return async (fsStage) => copyFromTemplate(projectTemplateId(project), ".idea", "runConfigurations", "test.xml").then(file => insert(fsStage, ".idea/runConfigurations/test.xml", file));
}
export function writeIdeaRunConfigurationStart(project) {
if (project.target === "webapp") {
return async (fsStage) => copyFromTemplate(projectTemplateId(project), ".idea", "runConfigurations", "start.xml").then(file => insert(fsStage, ".idea/runConfigurations/start.xml", file));
}
else {
return async (fsStage) => success(fsStage);
}
}
//# sourceMappingURL=write-run-configurations.js.map