yandex / tartifacts

:package: Create artifacts for your assemblies
MIT License
20 stars 9 forks source link

dest-dir option #66

Closed blond closed 6 years ago

blond commented 8 years ago

Example:

Need create artifact with project sources and write tarball next to the project directory.

project/
    sources/
project.tar.gz

Now we should use dest param in artifact info:

const tartifacts = require('tartifacts');

const artifacts = [
    {
        dest: '../project.tar.gz',
        patterns: [
            'sources/**',
            '!sources/exlib/**'
        ],
        tar: true,
        gzip: { level: 1 }
    }
];

tartifacts(artifacts, { root: 'path/to/project' });

Because of this, you can't describe config with artifacts in project. And you can't configure dest path using config.

Need add dest option to tartifacts and name parameter in artifact info:

const tartifacts = require('tartifacts');

const artifacts = [
    {
        name: 'project.tar.gz',
        patterns: [
            'sources/**',
            '!sources/exlib/**'
        ],
        tar: true,
        gzip: { level: 1 }
    }
];

tartifacts(artifacts, {
    root: 'path/to/project',
    destDir: path.join('path/to/project', '..')
});
anton-rudeshko commented 8 years ago

It's better to name it --dest-dir/destDir. Maybe also namefilename

blond commented 7 years ago

It's better to name it --dest-dir/destDir

Yep it's better, update description.

Maybe also name → filename

No, artifact name can be is directory.