Skip to content

Commit

Permalink
cmd/utils: avoid making console preloads absolute (#22109)
Browse files Browse the repository at this point in the history
Resolves etclabscore/core-geth#273

jsre.JSRE already handles establishing preload
file paths relative to the 'assets' path (aka docroot),
where it joins the assets dir and the file path if relative,
or uses the file path only if absolute.

The duplication of this logic by MakeConsolePreloads
caused preloaded files to have paths which contained
duplicate references to the assets dir path.

Date: 2020-12-30 08:25:01-06:00
Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits authored and mandrigin committed Mar 9, 2021
1 parent a12aeca commit b82525b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1836,9 +1836,8 @@ func MakeConsolePreloads(ctx *cli.Context) []string {
// Otherwise resolve absolute paths and return them
var preloads []string

assets := ctx.GlobalString(JSpathFlag.Name)
for _, file := range strings.Split(ctx.GlobalString(PreloadJSFlag.Name), ",") {
preloads = append(preloads, common.AbsolutePath(assets, strings.TrimSpace(file)))
preloads = append(preloads, strings.TrimSpace(file))
}
return preloads
}
Expand Down

0 comments on commit b82525b

Please sign in to comment.