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

Operate On A Single File #7

Open
bdkjones opened this issue Dec 24, 2016 · 3 comments
Open

Operate On A Single File #7

bdkjones opened this issue Dec 24, 2016 · 3 comments

Comments

@bdkjones
Copy link

bdkjones commented Dec 24, 2016

It would be helpful if the CLI allowed running inky on a single file instead of a globbed path.

Reason:

I'm integrating inky into CodeKit (codekitapp.com) as part of support for Foundation Emails. When a user saves a single HTML file, it's incredibly wasteful to process ALL html files. I'd like to supply inky with an input path to a single file and an output path to a single file (rather than a directory).

@bdkjones
Copy link
Author

It's actually possible to do this:

inky path/to/somefile.html someOutputFolder

And inky will process somefile.html into someOutputFolder/somefile.html, but I'd like to control the actual name of the output file, not just specify a folder where it should go. If you attempt to pass a filename for the destination parameter, inky just throws an error that the parameter is not a directory.

@kball
Copy link

kball commented Jan 4, 2017

Hmm this is kind of interesting... looking into it, if the 2nd argument (will from here forward call it output) does not exist I don't see any current way to infer if you want the output to be a single file with that name, or a file in a directory with that name.

I can see one of 2 ways to do this...

  1. Assume that if you have specified a single file, and the output you specify does not exist, you want the output to be a single file with the output name.

  2. Behave as we do currently (output is always a directory) and add an additional parameter to explicitly change the name, possibly using as a commandline options.

I believe number 2 is safer, but not clear if it's intuitive. @bdkjones do you care?

@rafibomb @tdhartwick do you have opinions on the right way to do this?

@bdkjones
Copy link
Author

bdkjones commented Jan 4, 2017

Other tools take a variety of approaches. Some have a specific --out-dir parameter that specifies a specific output folder. Others intuit what to do based on whether the output parameter ends with a file extension (if it does, use the last path component of the output parameter as the file name and all earlier path components as the directory to write to). Which approach doesn't matter to me as long as it's documented so I can use it!

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

No branches or pull requests

2 participants