Last active
February 22, 2021 12:11
-
-
Save itang/0a05b1cd222bb113a3ebf82927783ccf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
desc as description, | |
run, | |
sh, | |
shCapture, | |
task, | |
} from "https://deno.land/x/[email protected]/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