Skip to content

Commit

Permalink
Replacing package for better OS cross-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Kulash committed Jan 28, 2021
1 parent b00095e commit a570cb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cli/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"fmt"
"io/ioutil"
"os/user"
"regexp"
"strings"

Expand Down Expand Up @@ -490,8 +491,8 @@ func disableRule(rule *management.Rule, cli *cli) error {
}

func parseFileByName(inputFile string) (string, error) {
inputFile = strings.Replace(inputFile, "~/", "../", -1)

usr, _ := user.Current()
inputFile = strings.Replace(inputFile, "~/", usr.HomeDir+"/", -1)
f, err := ioutil.ReadFile(inputFile)

if err != nil {
Expand Down

0 comments on commit a570cb5

Please sign in to comment.