forked from pgherveou/gulp-awspublish
/
rename.js
30 lines (23 loc) · 818 Bytes
/
rename.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var fs = require('fs');
var gulp = require('gulp');
var gutil = require('gulp-util');
var rename = require('gulp-rename');
var awspublish = require('../');
var credentials = JSON.parse(fs.readFileSync('aws-credentials.json', 'utf8'));
var publisher = awspublish.create(credentials);
// gulp.src('examples/fixtures/*.js')
// .pipe(rename(function (path) {
// path.dirname += '/s3-examples';
// path.basename += '-s3';
// }))
// .pipe(publisher.publish())
// .pipe(awspublish.reporter());
// gulp.src('**/*.js', {cwd: 'examples'})
// .pipe(publisher.publish())
// .pipe(awspublish.reporter());
gulp.src('public/assets/**', {cwd: 'examples'})
.pipe(rename(function (path) {
path.dirname = 'public/assets/' + path.dirname;
}))
.pipe(publisher.publish())
.pipe(awspublish.reporter());