grim/convey

Fix the path for script attributes so it works on docker4mac/win. Fixes #91
  • +2 -0
    ChangeLog
  • +14 -1
    docker/run.go
  • --- a/ChangeLog Tue May 02 21:31:02 2017 -0500
    +++ b/ChangeLog Tue May 02 21:49:17 2017 -0500
    @@ -2,6 +2,8 @@
    * Added support for ssh-identities in the config file. (fixed #88)
    * Add an example showing a traditional CI build. (fixed #90)
    * Made meta-plan edge's dashed and bolded to make them more obvious. (fixed #85)
    + * Fixed the script option for the run command on docker4mac and docker4win.
    + (fixed #91)
    * Fixed a bug where always edges weren't being rendered in the graphviz
    output. (fixed #86)
    * Fixed always stages to have edges from all previous stages. (fixed #89)
    --- a/docker/run.go Tue May 02 21:31:02 2017 -0500
    +++ b/docker/run.go Tue May 02 21:49:17 2017 -0500
    @@ -22,6 +22,7 @@
    "io/ioutil"
    "os"
    "os/user"
    + "path/filepath"
    "strings"
    "github.com/aphistic/gomol"
    @@ -104,8 +105,20 @@
    entryPoint = "/bin/sh"
    }
    + // figure out the current working directory
    + pwd, err := os.Getwd()
    + if err != nil {
    + return err
    + }
    +
    + // now get the absolute path
    + absPwd, err := filepath.Abs(pwd)
    + if err != nil {
    + return err
    + }
    +
    // create the temp file to write the script to
    - script, err := ioutil.TempFile("", "convey-script-")
    + script, err := ioutil.TempFile(absPwd, "convey-script-")
    if err != nil {
    return err
    }