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

Transform artifacts #79

Open
blond opened this issue Nov 3, 2016 · 1 comment
Open

Transform artifacts #79

blond opened this issue Nov 3, 2016 · 1 comment
Milestone

Comments

@blond
Copy link
Collaborator

blond commented Nov 3, 2016

Now we can create artifact with JS object.

const tartifacts = require('tartifacts');

const artifacts = [
    {
        dest: 'artifact.tar.gz',
        includes: 'sources/**',
        excludes: 'sources/exlib/**'
        tar: true,
        gzip: { level: 1 }
    }
];

tartifacts(artifact)
    .then(() => console.log('Copying or packaging completed!'))
    .catch(err => console.log(err));

In the artifact will be added found files.

But we may need change files in artifact.

For example you may need add prefix to all files, or add files to artifact.

const tartifacts = require('tartifacts');
const rename = require('gulp-rename');
const add = require('gulp-add');

const artifact = tartifacts.tartifact({
    dest: 'artifact.tar.gz',
    includes: 'sources/**',
    excludes: 'sources/exlib/**'
    tar: true,
    gzip: { level: 1 }
})
.pipe(rename(path => { path.dirname += "/path/to/prefix"; }))
.pipe(add('filename1.txt', 'First file contents'));

tartifacts(artifact)
    .then(() => console.log('Copying or packaging completed!'))
    .catch(err => console.log(err));

The artifact created with tartifacts.tartifact should be Readable Stream with object chunks in vinyl format.

@blond blond added this to the 2.1.0 milestone Nov 3, 2016
@ghost
Copy link

ghost commented Nov 3, 2016

👍

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