Skip to content

Commit

Permalink
Reverting relative path to absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
akrami committed Jul 10, 2024
1 parent b0d0e06 commit 766ad56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Binary file modified build/dockonaut
Binary file not shown.
15 changes: 7 additions & 8 deletions internal/docker/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ func (project *Project) Start() error {
os.MkdirAll(getAbsoluteProjectPath(*project), os.ModePerm)
if project.Local != "" {
var srcDir string
if !strings.HasPrefix(project.Local, "/") {
srcDir = "./" + project.Local
if strings.HasPrefix(project.Local, "/") {
srcDir = project.Local
} else {
root, _ := os.Getwd()
srcDir = root + "/" + project.Local
}
err := copyutil.CopyDir(filesys.MakeFsOnDisk(), srcDir, getRelativeProjectPath(*project))
err := copyutil.CopyDir(filesys.MakeFsOnDisk(), srcDir, getAbsoluteProjectPath(*project))
if err != nil {
return errors.Join(errors.New("cannot copy directory "+srcDir+" to "+getRelativeProjectPath(*project)), err)
return errors.Join(errors.New("cannot copy directory "+srcDir+" to "+getAbsoluteProjectPath(*project)), err)
}
} else {
gitArgs := []string{"clone", project.Repository, getAbsoluteProjectPath(*project)}
Expand Down Expand Up @@ -160,7 +163,3 @@ 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 766ad56

Please sign in to comment.