MathieuLoutre / grunt-aws-s3

Grunt plugin to interact with AWS S3 using the AWS SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Common actions

martendegroot opened this issue · comments

Is it possible to keep a common actionlist, and only change the options per config?
Example:

So instead of:

aws_s3: {
    options: {
        region: 'eu-west-1'
    },
    dev: {
        options: {
            bucket: 'dev.domain.com'
        },
        files: [
            {src: 'index.html', dest: 'index.html', action: 'copy'}
        ]
    },
    prod: {
        options: {
            bucket: 'www.domain.com'
        },
        files: [
            {src: 'index.html', dest: 'index.html', action: 'copy'}
        ]
    }
}

Being able to write something like:

aws_s3: {
    options: {
        region: 'eu-west-1'
    },
    files: [
        {src: 'index.html', dest: 'index.html', action: 'copy'}
    ],
    dev: {
        options: {
            bucket: 'dev.domain.com'
        }
    },
    prod: {
        options: {
            bucket: 'www.domain.com'
        }
    }
}

In my actual code that would save me a great deal of duplicate code