Skip to content

Commit

Permalink
Chown all files and folders after git checkout
Browse files Browse the repository at this point in the history
Signed-off-by: JenTing Hsiao <[email protected]>
  • Loading branch information
jenting committed Aug 26, 2022
1 parent 17c777f commit 5716331
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/content-service/pkg/initializer/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping)
return src, xerrors.Errorf("git initializer gitClone: %w", err)
}

if ws.Chown {
defer func() {
span.SetTag("Chown", ws.Chown)
if !ws.Chown {
return
}
// TODO (aledbf): refactor to remove the need of manual chown
args := []string{"-R", "-L", "gitpod", ws.Location}
cmd := exec.Command("chown", args...)
Expand All @@ -124,7 +128,8 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping)
}
return
}
}
}()

if err := ws.realizeCloneTarget(ctx); err != nil {
return src, xerrors.Errorf("git initializer clone: %w", err)
}
Expand Down

0 comments on commit 5716331

Please sign in to comment.