本文整理匯總了Golang中github.com/hashicorp/otto/helper/vagrant.Dev函數的典型用法代碼示例。如果您正苦於以下問題:Golang Dev函數的具體用法?Golang Dev怎麽用?Golang Dev使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Dev函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Dev
func (a *App) Dev(ctx *app.Context) error {
var layered *vagrant.Layered
// We only setup a layered environment if we've recompiled since
// version 0. If we're still at version 0 then we have to use the
// non-layered dev environment.
if ctx.CompileResult.Version > 0 {
// Read the go version, since we use that for our layer
version, err := oneline.Read(filepath.Join(ctx.Dir, "dev", "node_version"))
if err != nil {
return err
}
// Setup layers
layered, err = vagrant.DevLayered(ctx, []*vagrant.Layer{
&vagrant.Layer{
ID: fmt.Sprintf("node%s", version),
Vagrantfile: filepath.Join(ctx.Dir, "dev", "layer-base", "Vagrantfile"),
},
})
if err != nil {
return err
}
}
// Build the actual development environment
return vagrant.Dev(&vagrant.DevOptions{
Instructions: strings.TrimSpace(devInstructions),
Layer: layered,
}).Route(ctx)
}
示例2: Dev
func (a *App) Dev(ctx *app.Context) error {
r := vagrant.Dev(&vagrant.DevOptions{
Instructions: strings.TrimSpace(devInstructions),
})
// Add our customer actions
r.Actions["scriptpack-rebuild"] = &router.SimpleAction{
ExecuteFunc: a.actionRebuild,
SynopsisText: actionRebuildSyn,
HelpText: strings.TrimSpace(actionRebuildHelp),
}
r.Actions["scriptpack-test"] = &router.SimpleAction{
ExecuteFunc: a.actionTest,
SynopsisText: actionTestSyn,
HelpText: strings.TrimSpace(actionTestHelp),
}
return r.Route(ctx)
}
示例3: Dev
func (a *App) Dev(ctx *app.Context) error {
return vagrant.Dev(&vagrant.DevOptions{
Instructions: strings.TrimSpace(devInstructions),
}).Route(ctx)
}