Build server prototype (integration with GitHub / NuGet / etc)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
micro-build-server/BuildServer/lib/tasks/index.ts

21 lines
535 B

"use strict";
8 years ago
import { readdirSync } from "fs";
import * as _ from "underscore";
8 years ago
import { Tasks } from "../types";
const taskNames = _.unique(readdirSync(__dirname).map((file) => {
if (file.match(/\.ts$/) !== null) {
return file.substr(0, file.length - 3);
}
if (file.match(/\.js$/) !== null) {
return file.substr(0, file.length - 3);
}
return "";
}).filter((file) => file && file !== "index"));
export default _.object(taskNames.map((name) => [name, require(`./${name}`).default])) as Tasks;