Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
Updated Gruntfile.js to support host option
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Rynarzewski authored and Pawel Rynarzewski committed Jul 11, 2014
1 parent a7a8318 commit 1a8e203
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
module.exports = function (grunt) {
'use strict';

grunt.config('cumulocity.host', 'integration.cumulocity.com');
grunt.config('cumulocity.protocol', 'http');
var DEFAULT_HOST = 'integration.cumulocity.com',
DEFAULT_PROTOCOL = 'http',
host = DEFAULT_HOST,
protocol = DEFAULT_PROTOCOL;

if (grunt.option('host')) {
host = grunt.option('host');
if (host === 'developer') {
host = 'developer.cumulocity.com';
}

if (host === 'developer.cumulocity.com') {
protocol = 'https';
}
}

grunt.config('cumulocity.host', host);
grunt.config('cumulocity.protocol', protocol);

grunt.config('paths.root', './');
grunt.config('paths.temp', '.tmp');
Expand Down

0 comments on commit 1a8e203

Please sign in to comment.