Skip to content

Commit

Permalink
Default to error on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jscarmona committed Aug 12, 2016
1 parent 90a845e commit a35ee1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/tasks/publish-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
toolsVersion: 12.0,
stdout: false,
stderr: true,
errorOnFail: true,
properties: {
DeployOnBuild: true,
DeployDefaultTarget: 'WebPublish',
Expand Down Expand Up @@ -91,6 +92,7 @@ export default {

gulp.src(file.path)
.pipe(msbuild(options))
.on('error', error)
.on('end', () => { this.resume(); });
}
},
Expand Down
28 changes: 16 additions & 12 deletions src/tasks/publish-tds.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
toolsVersion: 12.0,
stdout: false,
stderr: true,
errorOnFail: true,
properties: {
DeployOnBuild: true,
DeployDefaultTarget: 'WebPublish',
Expand Down Expand Up @@ -67,30 +68,33 @@ export default {
* @param {Function} error
*/
fn(config, end, error) {
const src = yargs.argv.src || yargs.argv.s || config.src;
const dest = yargs.argv.dest || yargs.argv.d;
const url = yargs.argv.url || yargs.argv.u;
const options = config.options;
const src = yargs.argv.src || yargs.argv.s || config.src;
const dest = yargs.argv.dest || yargs.argv.d || options.properties.SitecoreDeployFolder;
const url = yargs.argv.url || yargs.argv.u || options.properties.SitecoreWebUrl;

options.properties.SitecoreWebUrl = url || options.properties.SitecoreWebUrl;
options.properties.SitecoreDeployFolder = dest || options.properties.SitecoreDeployFolder;
options.configuration = yargs.argv.build || yargs.argv.b || options.configuration;
if (url) {
options.properties.SitecoreWebUrl = url;
}

try {
gulp.src(src)
.pipe(es.through(build))
.on('end', end);
} catch (e) {
error(e.message);
if (dest) {
options.properties.SitecoreDeployFolder = dest;
}

options.configuration = yargs.argv.build || yargs.argv.b || options.configuration;

gulp.src(src)
.pipe(es.through(build))
.on('end', end);

function build(file) {
IGNITE_UTILS.log(`${path.basename(file.path, path.extname(file.path))}`);

this.pause();

gulp.src(file.path)
.pipe(msbuild(options))
.on('error', error)
.on('end', () => { this.resume(); });
}
},
Expand Down

0 comments on commit a35ee1a

Please sign in to comment.