Skip to content

Commit

Permalink
added error handling for copying local projects
Browse files Browse the repository at this point in the history
  • Loading branch information
akrami committed Jul 10, 2024
1 parent e8b7d21 commit 80e12b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/docker/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func (project *Project) Start() error {
root, _ := os.Getwd()
srcDir = root + "/" + project.Local
}
copyutil.CopyDir(filesys.MakeFsOnDisk(), srcDir, getAbsoluteProjectPath(*project))
err := copyutil.CopyDir(filesys.MakeFsOnDisk(), srcDir, getRelativeProjectPath(*project))
if err != nil {
return errors.Join(errors.New("cannot copy directory "+srcDir+" to "+getRelativeProjectPath(*project)), err)
}
} else {
gitArgs := []string{"clone", project.Repository, getAbsoluteProjectPath(*project)}
if project.Branch != "" {
Expand Down Expand Up @@ -160,3 +163,7 @@ func getAbsoluteProjectPath(project Project) string {
root, _ := os.Getwd()
return root + "/workspace/" + project.Name
}

func getRelativeProjectPath(project Project) string {
return "./workspace" + project.Name
}

0 comments on commit 80e12b1

Please sign in to comment.