Skip to content

Commit

Permalink
Merge branch 'josh3ennett-feature-gulp-expand-step-templates'
Browse files Browse the repository at this point in the history
  • Loading branch information
hnrkndrssn committed Jun 29, 2015
2 parents 4e4e0f4 + 6de90f9 commit 6c14881
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var replace = require('gulp-replace');
var sourceUrl = require('gulp-source-url');
var filter = require('gulp-filter');
var childProcess = require('child_process');
var data = require('gulp-data');

var reExt = function(ext) {
return rename(function(path) { path.extname = ext; })
Expand Down Expand Up @@ -211,6 +212,26 @@ gulp.task('install-snapshot', ['snapshot'], function() {
.pipe(gulp.dest('dist/public/generated'));
});

gulp.task('expand-step-templates' , function() {
return gulp.src(['step-templates/*.json'])
.pipe(data(function(file) {
var content = String(file.contents);
try{
var json = JSON.parse(content);
} catch(ex){
console.log("warning failed to parse \n" + content);
return new Buffer(file.contents).attributes;
}
file.contents = new Buffer(json.Properties["Octopus.Action.Script.ScriptBody"]);
return content.attributes;
}))
.pipe(rename({
dirname: "step-templates",
extname: ".ps1"
}))
.pipe(gulp.dest('tmp'));
});

gulp.task('build', ['install-snapshot']);

gulp.task('default', ['build']);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"gulp": "~3.6.2",
"gulp-clean": "~0.2.4",
"gulp-concat": "~2.2.0",
"gulp-data": "^1.2.0",
"gulp-filter": "~0.4.1",
"gulp-footer": "~1.0.4",
"gulp-grunt": "^0.4.1",
Expand Down

0 comments on commit 6c14881

Please sign in to comment.