lambtron / emojipacks

CLI to bulk upload emojis to your Slack
https://emojipacks.com
MIT License
1.32k stars 198 forks source link

Allow upload of local files. #112

Open WhileLoop opened 7 years ago

WhileLoop commented 7 years ago

Is this possible? Didn't see anything in the readme about it.

zachfeldman commented 7 years ago

Yeah I think you could make a YAML file that just points to files on your local machine, have you tried that?

WhileLoop commented 7 years ago

Tried it. Maybe I got the syntax wrong?

Uploading aws with ./aws.png (node:23728) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Invalid URI "./aws.png"

Uploading aws with file://./aws.png (node:23777) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Invalid protocol: file:

zachfeldman commented 7 years ago

Have you tried an absolute path instead of a relative one?

WhileLoop commented 7 years ago

Absolute path didn't work either.

zachfeldman commented 7 years ago

@WhileLoop Got it. I took a deeper dive into the upload method and realized it loads emojis using the request() lib: https://github.com/lambtron/emojipacks/blob/master/lib/slack.js#L188

In order to load local files, you'd have to integrate a local file reader. Here's a a similar thread: http://stackoverflow.com/questions/30851520/get-local-json-file-using-request-promise

Alternately, you could upload them somewhere temporary and take them down when you're done - you don't need to commit the .yaml file to the repo to use it!

kinduff commented 7 years ago

:+1:

EaterOA commented 7 years ago

You can also run a local http server (e.g. python3 -m http.server). Then you can use localhost urls.

kinduff commented 7 years ago

Nice workaround @EaterOA

moustachedelait commented 6 years ago

Any recommendations on how to generate a YAML file of a local directory of images?