Skip to content

Commit

Permalink
fixed aws#796
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhopaul123 committed Jun 19, 2019
1 parent b74a352 commit 40b6dca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ecs-cli/modules/cli/local/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/local/converter"
Expand All @@ -32,10 +33,11 @@ import (
"github.com/urfave/cli"
)

const (
LocalOutDefaultFileName = "docker-compose.local.yml"
var (
wd, _ = os.Getwd()
LocalOutDefaultFileName = filepath.Join(wd, "docker-compose.local.yml")
LocalOutFileMode = os.FileMode(0600) // Owner=read/write, Other=none
LocalInFileName = "task-definition.json"
LocalInFileName = filepath.Join(wd, "task-definition.json")
)

// Interface for a local project, holding data needed to convert an ECS Task Definition to a Docker Compose file
Expand Down
5 changes: 4 additions & 1 deletion ecs-cli/modules/cli/local/project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"flag"
"io/ioutil"
"os"
"strings"
"testing"

"github.com/aws/amazon-ecs-cli/ecs-cli/modules/commands/flags"
Expand All @@ -34,7 +35,9 @@ func TestWrite(t *testing.T) {

oldOpenFile := openFile
openFile = func(filename string) (*os.File, error) {
tmpfile, err := ioutil.TempFile("", filename)
tmpFileNameList := strings.Split(filename, string(os.PathSeparator))
tmpFileName := tmpFileNameList[len(tmpFileNameList)-1]
tmpfile, err := ioutil.TempFile("", tmpFileName)
assert.NoError(t, err, "Unexpected error in creating temp compose file")
defer os.Remove(tmpfile.Name())

Expand Down

0 comments on commit 40b6dca

Please sign in to comment.