Skip to content

Commit

Permalink
Support cross-platform filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
mingrammer committed Dec 5, 2016
1 parent 48e3502 commit 77a1189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"

Expand All @@ -18,7 +19,7 @@ func setupTestCase(t *testing.T) {
t.Log("Setup testcase")

homeDir = manager.GetHomeDir()
memoFile = homeDir + "/.gomo-tmp/memo.json"
memoFile = filepath.Join(homeDir, ".gomo-tmp", "memo.json")

os.Remove(memoFile)
}
Expand All @@ -27,7 +28,7 @@ func teardownTestCase(t *testing.T) {
t.Log("Teardown testcase")

homeDir = manager.GetHomeDir()
memoFile = homeDir + "/.gomo-tmp/memo.json"
memoFile = filepath.Join(homeDir, ".gomo-tmp", "memo.json")

os.Remove(memoFile)
}
Expand Down
3 changes: 2 additions & 1 deletion manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"os"
"path/filepath"
"runtime"
)

Expand All @@ -26,7 +27,7 @@ func New() *Manager {
homeDir := GetHomeDir()

return &Manager{
file: homeDir + "/.gomo/memo.json",
file: filepath.Join(homeDir, ".gomo", "memo.json"),
commands: make(map[string]Command),
}
}
Expand Down

0 comments on commit 77a1189

Please sign in to comment.