Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from asunlabs/bugfix/filePath
Browse files Browse the repository at this point in the history
Bugfix/file path
  • Loading branch information
jakesung-harborx authored Nov 6, 2022
2 parents d23d77e + 06231c8 commit 5b26278
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
.env.production
.env.development
.env.test
owlly-for-mac
owlly-for-mac-m1
owlly.exe

# Pre-feature
src
Expand Down
10 changes: 5 additions & 5 deletions owlly.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func getEnvList() []string {
func registerEnvs() {
for _, v := range getEnvList() {
wd, _ := os.Getwd()
filePath := strings.Join([]string{wd, "\\", v}, "")
filePath := strings.Join([]string{wd, "/", v}, "")

wErr := watcher.Add(filePath)
nilChecker(wErr)
Expand Down Expand Up @@ -78,7 +78,7 @@ func updateEnvs() {
nilChecker(rErr)

wrapDirName := "config"
wrapDirPath := strings.Join([]string{wd, "\\", wrapDirName, "\\"}, "")
wrapDirPath := strings.Join([]string{wd, "/", wrapDirName, "/"}, "")
wrapEnvName := strings.Join([]string{v, ".", wrapDirName}, "")
wrapEnvFile := strings.Join([]string{wrapDirPath, wrapEnvName}, "")

Expand All @@ -90,7 +90,7 @@ func updateEnvs() {
func cleanupEnvs() {
wd, _ := os.Getwd()
for _, v := range getEnvList() {
fullPathForWrapEnv := strings.Join([]string{wd, "\\", "config", "\\", v, ".config"}, "")
fullPathForWrapEnv := strings.Join([]string{wd, "/", "config", "/", v, ".config"}, "")
_, sErr := os.Stat(fullPathForWrapEnv)

if ok := os.IsExist(sErr); ok {
Expand Down Expand Up @@ -120,7 +120,7 @@ func sendSlackDM() {

for _, v := range getEnvList() {
if isDone := isUpdateFinished(); isDone[v] {
fullPathForWrapEnv := strings.Join([]string{wd, "\\", "config", "\\", v, ".config"}, "")
fullPathForWrapEnv := strings.Join([]string{wd, "/", "config", "/", v, ".config"}, "")
wrapEnvName := strings.Join([]string{v, ".config"}, "")

envStringForWrapEnv = convertEnvMapToString(fullPathForWrapEnv, wrapEnvName)
Expand All @@ -137,7 +137,7 @@ func isUpdateFinished() map[string]bool {

for _, v := range getEnvList() {
wd, _ := os.Getwd()
fullPath := strings.Join([]string{wd, "\\", v}, "")
fullPath := strings.Join([]string{wd, "/", v}, "")

_data, _rErr := os.ReadFile(fullPath)
nilChecker(_rErr)
Expand Down

0 comments on commit 5b26278

Please sign in to comment.