Skip to content

Instantly share code, notes, and snippets.

@itang
Last active February 22, 2021 12:11
Show Gist options
  • Save itang/0a05b1cd222bb113a3ebf82927783ccf to your computer and use it in GitHub Desktop.
Save itang/0a05b1cd222bb113a3ebf82927783ccf to your computer and use it in GitHub Desktop.
import {
desc as description,
run,
sh,
shCapture,
task,
} from "https://deno.land/x/drake@v1.4.6/mod.ts";
interface DevEnvTask {
name: string;
cwd: string;
cmd: string;
desc?: string;
}
const tasks: DevEnvTask[] = [
{
name: "redis",
cwd: "D:\\dev-env\\redis-latest",
cmd: ".\\redis-server.exe redis.single.conf",
desc: "redis",
},
{
name: "zk",
cwd: "D:\\dev-env\\apache-zookeeper-3.6.1-bin",
cmd: "bin\\zkServer.cmd",
desc: "zookeeper",
},
];
for (const { name, cwd, cmd, desc } of tasks) {
description(desc ?? name);
task(name, [], async function () {
const { code, output, error } = await shCapture(
cmd,
{
cwd: cwd,
stdout: "inherit",
stderr: "inherit",
},
);
console.log(code, output, error);
});
}
await run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment