Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need a way to specify output file #188

Open
clarkevans opened this issue Sep 22, 2018 · 3 comments
Open

need a way to specify output file #188

clarkevans opened this issue Sep 22, 2018 · 3 comments

Comments

@clarkevans
Copy link

clarkevans commented Sep 22, 2018

Currently, the inliner script writes to stdout. I'm not sure what the exact issue is, but it wouldn't work on GitLab's CI service, the file would be created but would be zero length when using > redirection. Anyway, it was easy enough to write a simple script that works, hard coding paths. It'd also be helpful to have default size that is a bit bigger, large SVG files don't get inlined by default. Thank you so much.

#!/usr/bin/env node                                                     
var inliner = require("inliner");
var fs = require("fs");

new inliner("build/index.html", {size : 1024* 1024 }, 
  function(err, text) {
    if(err) {
       console.log(err);
       process.exit(1);
    }
    fs.writeFile("demo.html", text, 
      function(err) {
        if(err) {
           console.log(err);
           process.exit(1);
        }
    });
  });
@clarkevans
Copy link
Author

Hmm. This may not be the core issue. Perhaps it's that inliner.js expects
that it is outputting to a terminal? see inliner/cli/progress.js

@wifiuk
Copy link

wifiuk commented Oct 4, 2022

+1 needs a -o FILENAME.html option

@an-dr-eas-k
Copy link

The core issue is here:

argv.useStdin = !process.stdin.isTTY;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants