Skip to content

Commit 54f32b7

Browse files
authored
Merge pull request #81 from codecrafters-io/andy/clean-up-GetRepositoryDir-err-msg
CC-2184: Clean up err msg in GetRepositoryDir
2 parents 934e829 + 1e57e24 commit 54f32b7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

internal/utils/repository_dir.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ func GetRepositoryDir() (string, error) {
1919
if err != nil {
2020
if _, ok := err.(*exec.ExitError); ok {
2121
if regexp.MustCompile("not a git repository").Match(outputBytes) {
22-
fmt.Fprintf(os.Stderr, "The current directory is not within a Git repository.\n")
23-
fmt.Fprintf(os.Stderr, "Please run this command from within your CodeCrafters Git repository.\n")
24-
25-
return "", errors.New("used not in a repository")
22+
return "", errors.New(`Error: The current directory is not within a Git repository.
23+
Please run this command from within your CodeCrafters Git repository.`)
2624
}
2725
}
2826

0 commit comments

Comments
 (0)