wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

Question about OutputDir #128

Closed g1eny0ung closed 4 years ago

g1eny0ung commented 5 years ago

@wjdp Thanks u very much for developing htmltest, it's very useful.

And I have a little question about OutputDir, this is my configuration:

OutputDir: ~/.htmltest

I want to output the results to my $HOME, but its output in my current repo folder:

image

How can I ouput it to $HOME? Thanks for the reply.

wjdp commented 5 years ago

Hey @g1eny0ung,

I don't think there's an easy way to get htmltest to write to your $HOME as, after joining, we're passing the paths from the config direct to go's WriteFile method (https://golang.org/pkg/io/ioutil/#WriteFile) which likely won't support environment variables.

A workaround to get what you want may be just to create a symlink in your current directory to your home dir. e.g. set OutputDir: .htmltest and

# ensure directory exists in home
mkdir -p ~/.htmltest
# symlink the home directory to our current directory
ln -s ~/.htmltest .htmltest
# run htmltest
htmltest
g1eny0ung commented 4 years ago

Thanks for explaining! Because I want to use docker to keep the cache dir for the next usage. Seems that I can move the folder to the persistent storage and move back for the next usage.