Skip to content

Commit

Permalink
Incorporate hotfix done on 'dev' to master
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryG13 committed Jun 15, 2020
2 parents 12e4d13 + 9ee36d5 commit 6bd6116
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/airtable-convertor/lib/interation.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package lib

import (
"bufio"
"fmt"
"os"
"path/filepath"
"strings"
)

// Interaction is holding some var for creating interaction
Expand All @@ -23,12 +25,14 @@ func NewInteraction() *Interaction {
func (i *Interaction) AskForInput() string {
exePath, _ := os.Executable()
cwd := filepath.Dir(exePath)

fmt.Printf("Filepath is not filled in. Actual path : %q\n", cwd)
fmt.Println("Enter the path to file:")

var input string
fmt.Scanln(&input)
return filepath.Join(cwd, input)
reader := bufio.NewReader(i.Input)
input, _ := reader.ReadString('\n')

return filepath.Join(cwd, strings.ReplaceAll(input, "\n", ""))
}

// Notify is a commun func to log some actions taken by the script
Expand Down

0 comments on commit 6bd6116

Please sign in to comment.