File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package wsl2
55
66import (
77 "context"
8+ "embed"
89 "fmt"
910 "net"
1011 "regexp"
@@ -159,8 +160,31 @@ func (l *LimaWslDriver) Validate(_ context.Context) error {
159160 return nil
160161}
161162
163+ //go:embed boot/*.sh
164+ var bootFS embed.FS
165+
162166func (l * LimaWslDriver ) BootScripts () (map [string ][]byte , error ) {
163- return map [string ][]byte {}, nil
167+ scripts := make (map [string ][]byte )
168+
169+ entries , err := bootFS .ReadDir ("boot" )
170+ if err != nil {
171+ return scripts , err
172+ }
173+
174+ for _ , entry := range entries {
175+ if entry .IsDir () {
176+ continue
177+ }
178+
179+ content , err := bootFS .ReadFile ("boot/" + entry .Name ())
180+ if err != nil {
181+ return nil , err
182+ }
183+
184+ scripts [entry .Name ()] = content
185+ }
186+
187+ return scripts , nil
164188}
165189
166190func (l * LimaWslDriver ) InspectStatus (ctx context.Context , inst * limatype.Instance ) string {
You can’t perform that action at this time.
0 commit comments