wesbaker / atom-docksend

MIT License
1 stars 1 forks source link

Related Sass not uploading #6

Closed ghost closed 6 years ago

ghost commented 8 years ago

I checked "Upload related Sass files". But Transmit only uploads the Sass file, where I am using the keystroke. Not the generated CSS file.

How do the package recognizes the path of related files?

Side note: Gulp is watching.

Edit: Could SCSS be the issue – therefore not Sass – I am using?

wesbaker commented 8 years ago

Sorry for the very late response, I've been busy with a new child lately.

How do the package recognizes the path of related files?

If you try to upload something.scss, I then look for something.css and something.min.css in the same directory. Are your generated files in another directory?

jansent commented 7 years ago

It'd be nice to have some configuration for this function. For example I am working on a wordpress theme. My sass files are in a css folder and all compile down to style.css in the main directory. If I could somehow link all of the sass files to that one file it'd be very convenient.

wesbaker commented 7 years ago

It'd be nice to have some configuration for this function.

I don't use the feature to be honest, but I do agree. Adding another setting that allowed you to transverse directories wouldn't be too tough. I think the best situation would be to setup a map of sorts. You define the relative path from your project directory to the base of your SASS directory and the relative path to your generated files directory. If you upload a file from the SASS directory--whether in it or a subdirectory--then you find the associated file in the generated files (sub)directory.

Sound about right? I'm not sure this is something I'd take on, because it's not a feature I need or use, but if you'd like to take a crack at it, I'd be happy to review it.

jansent commented 7 years ago

I'm not very familiar with the Atom API but if you could point me in the right direction I'd be happy to contribute. I'm also trying to add a file tree context menu to upload (primarily because opening the compiled CSS file is so slow in atom)

wesbaker commented 7 years ago

if you could point me in the right direction I'd be happy to contribute.

So you want to take a look here. You'll see that the settings that are exposed to Atom are defined under config. Then, you'll see the logic that actually uploads the related files is in uploadRelatedFiles.

The file is CoffeeScript, so it's all just Javascript, nothing too bad. You'll need to:

  1. Add the settings that define the map. I think you'll need a set of maps per type. SASS and Less could probably be lumped together because you're presumably using just one, but (minified) javascript is likely stored elsewhere
  2. Modify uploadRelatedFiles to check that mapping and deal with it, while also continuing to work without that mapping
jansent commented 7 years ago

Thanks! I'll give it a go next time I'm feeling frisky.

I'm probably going to add a hacky command to upload a specific file for now (/style.css) - this would solve my problems.