You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A good fix to this problem would be to make reading of standard input explicitly enabled by the user. The user should explicitly enable it by adding a dash to the end of the inliner command:
Inliner automatically expects input to come from standard input when you run it under `execSync` as I'm now doing in the updated build pipeline.
Simply running Inliner under `execSync` shouldn't trigger this behaviour, I think it's a bug in Inliner.
As a workaround I've restructured Inliner to give it input via standard input.
I've created an issue to address the real problem:
remy/inliner#228
A simple repo is available here:
https://github.com/ashleydavis/inliner-issue
I've discovered an issue when you run
inliner
under the Node.jsexec
orexecSync
function.Take a working
inliner
command line this:npx inliner index.html > out/index.html
Put the same command line in a JavaScript file and run it through
execSync
:This causes an empty file to be written to
out/index.html
.I've created a simple example of the problem here, follow the readme for the repo case:
https://github.com/ashleydavis/inliner-issue
The problem originates with this line of code:
inliner/cli/options.js
Line 55 in df3619f
When inliner is invoked under
execSync
it setsisTTY
to false which setsuseStdin
to true.When
useStdin
is enabled nothing is read because no standard input is actually applied. Because nothing is read nothing is output:inliner/cli/index.js
Line 35 in df3619f
After I realised what this issue was I was able to construct a workaround which you can see in my example project.
The workaround requires rearranging the command to actually give it the input via standard input:
A good fix to this problem would be to make reading of standard input explicitly enabled by the user. The user should explicitly enable it by adding a dash to the end of the
inliner
command:You can see an example here of how the Kubectl tool does it.
The text was updated successfully, but these errors were encountered: