Skip to content

Commit

Permalink
Merge pull request #86 from auth0/fix/tilda-path-support
Browse files Browse the repository at this point in the history
Stripping and replacing tildas to fix bug
  • Loading branch information
cyx authored Jan 28, 2021
2 parents f98d138 + a570cb5 commit 75e3b82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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 @@ -491,8 +492,9 @@ func disableRule(rule *management.Rule, cli *cli) error {
return cli.api.Rule.Update(rule.GetID(), &management.Rule{Enabled: auth0.Bool(false)})
}

// TODO: Fix tildas when passing relative filepaths, e.g. ~/Downloads/example.js
func parseFileByName(inputFile string) (string, error) {
usr, _ := user.Current()
inputFile = strings.Replace(inputFile, "~/", usr.HomeDir+"/", -1)
f, err := ioutil.ReadFile(inputFile)

if err != nil {
Expand Down

0 comments on commit 75e3b82

Please sign in to comment.