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

Possible to exclude archives that would be empty? #212

Open
Graham-Phillips opened this issue Apr 18, 2019 · 0 comments
Open

Possible to exclude archives that would be empty? #212

Graham-Phillips opened this issue Apr 18, 2019 · 0 comments

Comments

@Graham-Phillips
Copy link

My compress config creation function loops over many whitelabel folders, and creates zips of the assets it finds inside each white label:

var src = ['./asset/whitelabels/', '!.zip'];

grunt.file.expand({filter: 'isDirectory'}, module).forEach(function (dir) {

var compress = grunt.config.get('compress') || {};

	// set the config for this modulename-directory
	compress[dir] = {
		files:
				[
					{
						src: [
							dir + '**/graphics/**/*.png',
							dir + '**/core/**/*.mp3',

						]
					}
				],
		options:
				{
					archive: function () {
						return 'dist/' + dir.toLowerCase() + '.zip'
					}
				}
		};

	// save the new concat configuration
	grunt.config.set('compress', compress);
});

grunt.task.run('compress');

My problem is, if there were no assets within a particular whitelabel folder/subfolders, it creates an empty zip archive. I would like to skip the creation of empty archives, is it possible to specify that?
thanks

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

No branches or pull requests

1 participant