任务
少于1分钟
Tasks 任务
Tasks are small scripts that are often needed when writing an application. These tasks might be along the lines of seeding a database, parsing a log file, or even a release script. Buffalo uses the grift package to make writing these tasks simple.
任务通常是在编写应用程序时经常需要的脚本。这些任务可能包括填充数据库、解析日志文件,甚至发布脚本。Buffalo 使用 grift 包来简化编写这些任务。
Writing Tasks 编写任务
Tasks must all be in the grifts
package. A simple task would look like following:
所有任务都必须在 grifts
包中。一个简单的任务如下所示:
|
|
Tasks Generator 任务生成器
|
|
Listing Available Tasks 列出可用任务
|
|
Running Tasks 运行任务
Development 开发
Tasks can be run in development using the buffalo task
command.
可以使用 buffalo task
命令在开发中运行任务。
|
|
From a Built Binary 从已构建的二进制文件
After a binary has been built, the tasks can be run with the task
subcommand:
构建二进制文件后,可以使用 task
子命令运行任务:
|
|