MCPcopy Create free account
hub / github.com/coder/envbuilder / createPostStartScript

Function createPostStartScript

envbuilder.go:1478–1493  ·  view source on GitHub ↗
(path string, postStartCommand devcontainer.LifecycleScript)

Source from the content-addressed store, hash-verified

1476}
1477
1478func createPostStartScript(path string, postStartCommand devcontainer.LifecycleScript) error {
1479 postStartScript, err := os.Create(path)
1480 if err != nil {
1481 return err
1482 }
1483 defer postStartScript.Close()
1484
1485 if err := postStartScript.Chmod(0o755); err != nil {
1486 return err
1487 }
1488
1489 if _, err := postStartScript.WriteString("#!/bin/sh\n\n" + postStartCommand.ScriptLines()); err != nil {
1490 return err
1491 }
1492 return nil
1493}
1494
1495func newColor(value ...color.Attribute) *color.Color {
1496 c := color.New(value...)

Callers 1

execLifecycleScriptsFunction · 0.85

Calls 3

CloseMethod · 0.80
ChmodMethod · 0.80
ScriptLinesMethod · 0.80

Tested by

no test coverage detected