ego008
ego008
2094 0 0

用 JavaScript 来写 Shell

google 开源的一个玩具,可以用 JavaScript 来写 Shell 脚本

#!/usr/bin/env zx

await $`cat package.json | grep name`

let branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`

await Promise.all([
  $`sleep 1; echo 1`,
  $`sleep 2; echo 2`,
  $`sleep 3; echo 3`,
])

await $`ssh medv.io uptime`

代码 https://github.com/google/zx

0

See Also

Nearby


Discussion

Login Topics