simple-auto-script
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

auto-script

A simple script to reduce duplicate work.

Usage

$ npm install -g auto-script
$ auto-script COMMAND
running command...
$ auto-script (-v|--version|version)
auto-script/0.0.0 darwin-x64 node-v11.10.0
$ auto-script --help [COMMAND]
USAGE
  $ auto-script COMMAND
...

Commands

auto-script help [COMMAND]

display help for auto-script

USAGE
  $ auto-script help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

auto-script run

读取 autoscript.config.json 并执行脚本

USAGE
  $ auto-script run

OPTIONS
  -c, --config=config  指定配置文件
  -h, --help           显示帮助信息

EXAMPLE
  $ auto-script run

See code: src/commands/run.ts

configuration

example

{
  "web-portal": {
    "path": "/Users/wuzheqing/Documents/work/web-portal",
    "shell": [
      "npm run updateAll",
      "git add .",
      "git commit -m 'update'",
      "git push origin",
      "git push dice master_zoina_6:develop"
    ]
  },
  ...
}

每个 Task 以名字作 key, 并且会有两个属性: path 、shell

path (string)

要执行脚本的绝对路径

shell (string[])

要执行的脚本, 同步执行, 脚本之间没有上下环境切换

bad:

{
  "task": {
    "path": "/User/path/dir",
    "shell": ["mkdir example", "cd ./example", "touce test.js"]
  }
}

good:

{
  "task": {
    "path": "/User/path/dir",
    "shell": ["mkdir example", "cd ./example && touce test.js"]
  }
}

Readme

Keywords

Package Sidebar

Install

npm i simple-auto-script

Weekly Downloads

0

Version

0.0.0

License

MIT

Unpacked Size

4.83 kB

Total Files

6

Last publish

Collaborators

  • z7fiv5