github.com/wawandco/ox@v0.13.6-0.20230809142027-913b3d837f2a/plugins/tools/yarn/afterinitializer.go (about)

     1  package yarn
     2  
     3  import (
     4  	"context"
     5  	"os"
     6  	"os/exec"
     7  
     8  	"github.com/wawandco/ox/plugins/base/new"
     9  )
    10  
    11  type AfterInitializer struct{}
    12  
    13  func (ai AfterInitializer) Name() string {
    14  	return "yarn/afterinitializer"
    15  }
    16  
    17  func (ai AfterInitializer) AfterInitialize(ctx context.Context, options new.Options) error {
    18  	c := exec.CommandContext(ctx, "yarn", "install", "--no-progress")
    19  	c.Stdin = os.Stdin
    20  	c.Stderr = os.Stderr
    21  	c.Stdout = os.Stdout
    22  
    23  	return c.Run()
    24  }