當前位置: 首頁>>代碼示例>>Golang>>正文


Golang vagrant.Dev函數代碼示例

本文整理匯總了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)
}
開發者ID:rowhit,項目名稱:otto,代碼行數:31,代碼來源:app.go

示例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)
}
開發者ID:mbrodala,項目名稱:otto,代碼行數:20,代碼來源:app.go

示例3: Dev

func (a *App) Dev(ctx *app.Context) error {
	return vagrant.Dev(&vagrant.DevOptions{
		Instructions: strings.TrimSpace(devInstructions),
	}).Route(ctx)
}
開發者ID:nvartolomei,項目名稱:otto,代碼行數:5,代碼來源:app.go


注:本文中的github.com/hashicorp/otto/helper/vagrant.Dev函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。