Jump to content
Search Community

Anyone got a batch process for zipping their assets?

somnamblst test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I use a Gulp task for that. You could try something of the sort, even if you build all your ads in Flanimate (as you call it). 

 

It would be another step in your workflow - Guess it would be a lot better than zipping them one by one.

 

This is the snippet I use in my gulpfile.js (there's a whole host of other things going on the background - you can't just copy and paste this - it's just to give an idea)

gulp.task('zip', function() {
    var folders = getFolders('./build/');


    var tasks = folders.map(function(folder) {
      return gulp
        .src(path.join('deploy/', folder, '/*'))
        .pipe(plugin.zip(folder + '.zip'))
        .pipe(gulp.dest('deploy/'));
      });


    return tasks;
  })
Link to comment
Share on other sites

I can't take credit for the moniker Flanimate. Someone on the Adobe forum started calling it that, because of the very predictable confusion, thanks to the new name being too easy to confuse with Edge Animate.

 

 

I think what is going to make my scenario difficult is I have 11 versions in each folder, the one thing they have in common is size. The thing they don't have in common is file name.

Link to comment
Share on other sites

There is a way to make it happen if you need it to be. I'd be happy to write a little task for you at some point to see if it helps. Be warned, though, you would have to work with Command line tools. I do not know enough at the moment to write a self contained application.

 

The file name would not be an issue. There are ways to tell it to loop thru the files themselves. As long as you only need to pick one of each type.

Link to comment
Share on other sites

Thanks, Dipscom.

 

I don't have an issue with using the command line. My FLAs are also in the folders, so it would need to just grab a js and html file with the same name. I am using Win 7.

 

It literally takes seconds to create them, but it is just so monotonous.

 

Using Flanimate to create banners even at twice the size for retina display, I have zip files that are only 11-33K  :shock:

Link to comment
Share on other sites

Thanks, Dipscom.

 

I don't have an issue with using the command line. My FLAs are also in the folders, so it would need to just grab a js and html file with the same name. I am using Win 7.

 

It literally takes seconds to create them, but it is just so monotonous.

 

Using Flanimate to create banners even at twice the size for retina display, I have zip files that are only 11-33K  :shock:

I always just keep my FLAs in a separate folder, and change the publish settings so that the output files publish to their own folders (separate from the FLAs).  So in the end I can just zip up the folders without removing anything.

 

My folder structure looks like:

 

source

(FLAs go here)

deploy

banner folder name

images

image.jpg

image.jpg

HTML

JS

banner folder name

images

image.png

HTML

JS

 

And in publish settings I just set the output to be "../deploy/folderName/fileName". 

Link to comment
Share on other sites

Here you go. Thanks Dipscom

 

There are no FLAs in that folder.  The FLAs aren't an issue, but they do help me spot any versions, I forgot to preview, if I see FLA icons not separated by an html and js file, I know I forgot to preview.

 

I have found if you forget to preview as you churn through versions using guide layers, you won't get an html file, despite publishing.

Link to comment
Share on other sites

As promised somnamblst (and anybody else that finds himself having to zip several variations of the same thing). The attached zip has a little Gulp task runner setup.

 

It was made based on your folder structure. The way I planned it to work is for you to drop your files into the files folder (the .html, .js, images folder). And run the task. It will build a temp folder, then it will build a zipped folder.

 

For the ones that have no experience with Gulp and task runners:

 

1. Install NodeJS - https://nodejs.org/en/

2. Update NPM - https://docs.npmjs.com/getting-started/installing-node

3. Fix NPM permissions to save you headaches - https://docs.npmjs.com/getting-started/fixing-npm-permissions

4. Unzip the attached into a folder of your choice. You only need to do this once.

5. Open the command line application of your choice and navigate to the said folder.

6. Type: npm install and wait for it to finish.

7. While npm installs, you can drop your html, images and JS files into the files folder. The html and js filenames must match and your images are inside one images folder. That's how it was designed to work.

8. Once everything is installed, type in your command line application gulp.

9. The zipped files will be created inside a folder called zipped.

 

Any issues. let me know.

zippingTask.zip

  • Like 2
Link to comment
Share on other sites

One thing I've gotten dinged by in the past was invisible files that Mac OS creates (eg. .DS_Store). Also, I sometimes use CodeKit to automatically minify/compile/browser refresh, and it creates a bunch of hidden cache files as well - which is probably a good reason to switch to just using gulp or grunt for that stuff. Anyway, the validator site is handy for catching any hidden files that sneak into your .zip folder.

Link to comment
Share on other sites

I can only recommend getting used to one of the task runners out there. There's a lot to gain from using them. And they are far easier to use than you think.

 

Heck, there's plenty of recipes out there, all you really need to know is how to make them run.

  • Like 1
Link to comment
Share on other sites

Thanks Dipscom!

 

flysi3000 I got dinged for a hidden file when I did my zipping on a network server. Did not happen locally.

 

My FUBAR tip is to never assume that EPS you pasted from Illustrator was not a ginormous bitmap (1.5 MB) masquerading as a vector graphic, hiding in your published images folder, until you spot it right before zipping  :shock:

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...