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

Option to choose output image name #18

Closed
boudhayan-dev opened this issue Jul 14, 2018 · 12 comments
Closed

Option to choose output image name #18

boudhayan-dev opened this issue Jul 14, 2018 · 12 comments
Labels
feature-request New feature or request prerelease Integrated and usable via carbon-now-cli@next roadmap Likely to be implemented at some point

Comments

@boudhayan-dev
Copy link

Is it possible for the user to define the output image's name ? It seems to me that successive usage of the tool ends up overwriting the previous carbon.png instead of creating a new carbon(1).png.

@Keraito
Copy link

Keraito commented Jul 14, 2018

Currently not, but from what I understood from the code base that should not be a hard feature to implement. I can try something!

@mixn
Copy link
Owner

mixn commented Jul 14, 2018

@boudhayan-dev Currently, it isn’t, but as @Keraito said, shouldn’t be hard to implement. :) I am working on some other feature atm, but will add this small enhancement on that branch then and report back when done. Also, not a fan of doing this via a --flag, I think reusing the file-name.js name and making file-name.png is the better approach here. Or file-name–SOMEID.png.

@mixn mixn added feature-request New feature or request roadmap Likely to be implemented at some point labels Jul 14, 2018
@mixn
Copy link
Owner

mixn commented Jul 15, 2018

This (and more!) now ships as a prerelease of v1.1.0. :) More infos on how to install it can be found here.

Given

carbon-now foo.js

will save foo-ef52f53aab.png in cwd.

Given

carbon-now foo.js -l ~/Desktop

will save hi-acae3c51a1.png in ~/Desktop. The format, as I’ve noted before, is originalfilename-ID.extension. ID is based on nanoids generate module.

@boudhayan-dev Please be aware that you might have the same issues you’ve had in #10, as I’ve not merged @Sneezoo’s PR yet, due to lack of feedback. Just as a heads up. :)

@mixn mixn added the prerelease Integrated and usable via carbon-now-cli@next label Jul 15, 2018
@boudhayan-dev
Copy link
Author

boudhayan-dev commented Jul 15, 2018

@mixn Thank you. The new additional features are very helpful.

If you don't mind, could I ask, how soon can we expect @Sneezoo's fix in your update ?

@mixn
Copy link
Owner

mixn commented Jul 15, 2018

@boudhayan-dev I’m still waiting for more people to chime in on #10. So depends on that. Plus, @Sneezoo’s PR was kind of a dirty hotfix to see if Page.downloadBehavior actually was the problem. Him or me or both of us (we’re friends and colleagues) would have to properly integrate it still. But definitely on my radar. :)

Feel free to close this issue, since the above is related to #10 atm. Maybe @Keraito can confirm that this enhancement works as expected — I wouldn’t know why it shouldn’t though. :)

@Keraito
Copy link

Keraito commented Jul 15, 2018

I can try this out tomorrow and report back then 👍

@boudhayan-dev
Copy link
Author

@mixn Awesome.

@Keraito
Copy link

Keraito commented Jul 16, 2018

Looks all good to me @mixn. One remark, would it be of interest to add some static part to the format so it's easier to index, find, or exclude from a repo through gitignore? Maybe something simple like foo-cn-ef52f53aab.png?

@mixn
Copy link
Owner

mixn commented Jul 16, 2018

@Keraito You can always save to a particular folder via --location and then ignore that folder, no? :) I think that should be enough.

@Keraito
Copy link

Keraito commented Jul 16, 2018

Hmm yeah that sounds sufficient. Can close this issue then I think?

@mixn
Copy link
Owner

mixn commented Jul 16, 2018

@Keraito I’ll let @boudhayan-dev do the closing. :) Thanks for the input, guys!

@mixn
Copy link
Owner

mixn commented Sep 19, 2018

@boudhayan-dev @Keraito I thought I might leave this here, even though this has been closed for a while. TL;DR: --target is a thing now and allows for specific naming of the output image. :) 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request prerelease Integrated and usable via carbon-now-cli@next roadmap Likely to be implemented at some point
Projects
None yet
Development

No branches or pull requests

3 participants