Skip to content

Commit 12534e1

Browse files
committed
style(deploy): fixed up styling to pass jshint
1 parent 3b271ca commit 12534e1

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

deploy/index.js

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Generator.prototype.checkInstallation = function checkInstallation() {
1414
var done = this.async();
1515
this.rhcInstalled = false;
1616
this.herokuInstalled = false;
17-
if(this.name.toLowerCase() == "openshift" ){
17+
if(this.name.toLowerCase() === "openshift" ){
1818
exec('rhc --version', function (err) {
1919
if (err) {
2020
this.log.error('OpenShift\'s rhc command line interface is not available. ' +
@@ -24,7 +24,7 @@ Generator.prototype.checkInstallation = function checkInstallation() {
2424
}
2525
done();
2626
}.bind(this));
27-
}else if(this.name.toLowerCase() == 'heroku') {
27+
} else if(this.name.toLowerCase() === 'heroku') {
2828
exec('heroku --version', function (err) {
2929
if (err) {
3030
this.log.error('You don\'t have the Heroku Toolbelt installed. ' +
@@ -34,21 +34,21 @@ Generator.prototype.checkInstallation = function checkInstallation() {
3434
}
3535
done();
3636
}.bind(this));
37-
}else{
37+
} else {
3838
done();
3939
}
4040
};
4141

4242
Generator.prototype.copyProcfile = function copyProcfile() {
43-
if(this.name.toLowerCase() != "heroku") return;
43+
if(this.name.toLowerCase() !== "heroku") return;
4444
this.template('../deploy/heroku/Procfile', 'dist/Procfile');
4545
};
4646

4747
Generator.prototype.gruntBuild = function gruntBuild() {
48-
if(this.name.toLowerCase() != "heroku" &&
49-
this.name.toLowerCase() != "openshift" ) return;
48+
if(this.name.toLowerCase() !== "heroku" &&
49+
this.name.toLowerCase() !== "openshift" ) return;
5050
var done = this.async();
51-
51+
5252
console.log(chalk.bold('Building dist folder, please wait...'));
5353
exec('grunt build', function (err, stdout) {
5454
console.log('stdout: ' + stdout);
@@ -60,21 +60,21 @@ Generator.prototype.gruntBuild = function gruntBuild() {
6060
};
6161

6262
Generator.prototype.enableOpenShiftHotDeploy = function enableOpenshiftHotDeploy() {
63-
if(this.name.toLowerCase() != "openshift") return;
64-
this.log("enabling HotDeploy for OpenShift")
63+
if(this.name.toLowerCase() !== "openshift") return;
64+
this.log("enabling HotDeploy for OpenShift");
6565
this.template('../deploy/openshift/hot_deploy', 'dist/.openshift/markers/hot_deploy');
6666
};
6767

6868
Generator.prototype.gitInit = function gitInit() {
6969
var done = this.async();
70-
if(this.name.toLowerCase() == "heroku"){
70+
if(this.name.toLowerCase() === "heroku"){
7171
exec('git init && git add -A && git commit -m "Initial commit"', { cwd: 'dist' }, function (err) {
7272
if (err) {
7373
this.log.error(err);
7474
}
7575
done();
7676
}.bind(this));
77-
}else if(this.name.toLowerCase() == "openshift"){
77+
} else if(this.name.toLowerCase() === "openshift") {
7878
exec('git init && git add -A && git commit -m "Generating a fresh angular-fullstack application"', { cwd: 'dist' }, function (err, stdout, stderr) {
7979
this.log(stdout);
8080
if (stdout.search('nothing to commit') >= 0) {
@@ -84,33 +84,33 @@ Generator.prototype.gitInit = function gitInit() {
8484
}
8585
done();
8686
}.bind(this));
87-
}else{
87+
} else {
8888
done();
8989
}
9090
};
9191

9292
Generator.prototype.gitRemoteCheck = function gitRemoteCheck() {
9393
this.openshift_remote_exists = false;
94-
if(this.name.toLowerCase() != "openshift" || typeof this.dist_repo_url != 'undefined') return;
94+
if(this.name.toLowerCase() !== "openshift" || typeof this.dist_repo_url !== 'undefined') return;
9595
var done = this.async();
9696

97-
this.log("Checking for an existing git remote named 'openshift'...")
97+
this.log("Checking for an existing git remote named 'openshift'...");
9898
exec('git remote -v', { cwd: 'dist' }, function (err, stdout, stderr) {
99-
var lines = stdout.split('\n')
100-
var dist_repo = ''
99+
var lines = stdout.split('\n');
100+
var dist_repo = '';
101101
this.log('stdout: ' + stdout);
102102
if (err) {
103103
this.log.error(err);
104104
} else {
105-
var repo_url_finder = /openshift[ ]*/
106-
lines.forEach(function(line){
107-
if(line.search(repo_url_finder) == 0 && dist_repo == ''){
108-
var dist_repo_detailed = line.slice(line.match(repo_url_finder)[0].length)
109-
dist_repo = dist_repo_detailed.slice(0, dist_repo_detailed.length - 7)
110-
}})
111-
if (dist_repo != ''){
112-
console.log("Found an existing git remote for this app: "+dist_repo)
113-
this.dist_repo_url = dist_repo
105+
var repo_url_finder = /openshift[ ]*/;
106+
lines.forEach(function(line) {
107+
if(line.search(repo_url_finder) === 0 && dist_repo === '') {
108+
var dist_repo_detailed = line.slice(line.match(repo_url_finder)[0].length);
109+
dist_repo = dist_repo_detailed.slice(0, dist_repo_detailed.length - 7);
110+
}});
111+
if (dist_repo !== ''){
112+
console.log("Found an existing git remote for this app: "+dist_repo);
113+
this.dist_repo_url = dist_repo;
114114
this.openshift_remote_exists = true;
115115
}
116116
}
@@ -119,61 +119,61 @@ Generator.prototype.gitRemoteCheck = function gitRemoteCheck() {
119119
};
120120

121121
Generator.prototype.rhcAppShow = function rhcAppShow() {
122-
if(this.name.toLowerCase() != "openshift" || typeof this.dist_repo_url != 'undefined') return;
122+
if(this.name.toLowerCase() !== "openshift" || typeof this.dist_repo_url !== 'undefined') return;
123123
var done = this.async();
124124

125-
this.log("Checking for an existing OpenShift hosting evironment...")
125+
this.log("Checking for an existing OpenShift hosting evironment...");
126126
exec('rhc app show '+this.appname+' --noprompt', { cwd: 'dist' }, function (err, stdout, stderr) {
127-
var lines = stdout.split('\n')
128-
var dist_repo = ''
127+
var lines = stdout.split('\n');
128+
var dist_repo = '';
129129
if (stdout.search('Not authenticated') >= 0 || stdout.search('Invalid characters found in login') >= 0) {
130130
this.log.error('Error: Not authenticated. Run "rhc setup" to login to your OpenShift account and try again.');
131131
} else if (err) {
132132
this.log.error(err);
133133
} else {
134134
this.log(stdout);
135-
var repo_url_finder = / *Git URL: */
136-
lines.forEach(function(line){
137-
if(line.search(repo_url_finder) == 0){
138-
dist_repo = line.slice(line.match(repo_url_finder)[0].length)
139-
console.log("Found an existing git remote for this app: "+dist_repo)
140-
}})
141-
if (dist_repo != '') this.dist_repo_url = dist_repo
135+
var repo_url_finder = / *Git URL: */;
136+
lines.forEach(function(line) {
137+
if(line.search(repo_url_finder) === 0) {
138+
dist_repo = line.slice(line.match(repo_url_finder)[0].length);
139+
console.log("Found an existing git remote for this app: "+dist_repo);
140+
}});
141+
if (dist_repo !== '') this.dist_repo_url = dist_repo;
142142
}
143143
done();
144144
}.bind(this));
145145
};
146146

147147
Generator.prototype.rhcAppCreate = function rhcAppCreate() {
148-
if(this.name.toLowerCase() != "openshift" || typeof this.dist_repo_url != 'undefined') return;
148+
if(this.name.toLowerCase() !== "openshift" || typeof this.dist_repo_url !== 'undefined') return;
149149
var done = this.async();
150-
this.log("Creating your OpenShift hosting evironment...")
150+
this.log("Creating your OpenShift hosting evironment...");
151151
exec('rhc app create '+this.appname+' nodejs-0.10 mongodb-2.4 -s --noprompt --no-git NODE_ENV=production', { cwd: 'dist' }, function (err, stdout, stderr) {
152-
var lines = stdout.split('\n')
152+
var lines = stdout.split('\n');
153153
this.log(stdout);
154154
if (stdout.search('Not authenticated') >= 0 || stdout.search('Invalid characters found in login') >= 0) {
155155
this.log.error('Error: Not authenticated. Run "rhc setup" to login to your OpenShift account and try again.');
156156
} else if (err) {
157157
this.log.error(err);
158158
} else {
159-
var dist_repo = ''
160-
var repo_url_finder = / *Git remote: */
161-
lines.forEach(function(line){
162-
if(line.search(repo_url_finder) == 0){
163-
dist_repo = line.slice(line.match(repo_url_finder)[0].length)
164-
}})
165-
166-
if (dist_repo != '') this.dist_repo_url = dist_repo
167-
this.log("New remote git repo at: "+this.dist_repo_url)
159+
var dist_repo = '';
160+
var repo_url_finder = / *Git remote: */;
161+
lines.forEach(function(line) {
162+
if(line.search(repo_url_finder) === 0) {
163+
dist_repo = line.slice(line.match(repo_url_finder)[0].length);
164+
}});
165+
166+
if (dist_repo !== '') this.dist_repo_url = dist_repo;
167+
this.log("New remote git repo at: "+this.dist_repo_url);
168168
}
169169
done();
170170
}.bind(this));
171171
};
172172

173173
Generator.prototype.gitRemoteAdd = function gitRemoteAdd() {
174-
if(this.name.toLowerCase() != "openshift" || typeof this.dist_repo_url == 'undefined' || this.openshift_remote_exists) return;
174+
if(this.name.toLowerCase() !== "openshift" || typeof this.dist_repo_url === 'undefined' || this.openshift_remote_exists) return;
175175
var done = this.async();
176-
this.log("Adding remote repo url: "+this.dist_repo_url)
176+
this.log("Adding remote repo url: "+this.dist_repo_url);
177177

178178
exec('git remote add openshift '+this.dist_repo_url, { cwd: 'dist' }, function (err, stdout, stderr) {
179179
if (err) {
@@ -187,9 +187,9 @@ Generator.prototype.gitRemoteAdd = function gitRemoteAdd() {
187187
};
188188

189189
Generator.prototype.gitForcePush = function gitForcePush() {
190-
if(this.name.toLowerCase() != "openshift" || !this.openshift_remote_exists ) return;
190+
if(this.name.toLowerCase() !== "openshift" || !this.openshift_remote_exists ) return;
191191
var done = this.async();
192-
this.log(chalk.green("Uploading your initial application code.\n This may take "+chalk.bold('several minutes')+" depending on your connection speed..."))
192+
this.log(chalk.green("Uploading your initial application code.\n This may take "+chalk.bold('several minutes')+" depending on your connection speed..."));
193193

194194
exec('git push -f openshift master', { cwd: 'dist' }, function (err, stdout, stderr) {
195195
if (err) {
@@ -198,9 +198,9 @@ Generator.prototype.gitForcePush = function gitForcePush() {
198198
var host_url = '';
199199
this.log('stdout: ' + stdout);
200200
var before_hostname = 'ssh://xxxxxxxxxxxxxxxxxxxxxxxx@'.length;
201-
var after_hostname = this.dist_repo_url.length - ( this.appname.length + 12 )
202-
host_url = 'http://' + this.dist_repo_url.slice(before_hostname, after_hostname)
203-
201+
var after_hostname = this.dist_repo_url.length - ( this.appname.length + 12 );
202+
host_url = 'http://' + this.dist_repo_url.slice(before_hostname, after_hostname);
203+
204204
this.log(chalk.green('You\'re all set! Your app should now be live at \n\t' + chalk.bold(host_url)));
205205
this.log(chalk.yellow('After app modification run\n\t' + chalk.bold('grunt build') +
206206
'\nThen enter the dist folder to commit these updates:\n\t' + chalk.bold('cd dist && git commit -am "describe your changes here"')));
@@ -212,7 +212,7 @@ Generator.prototype.gitForcePush = function gitForcePush() {
212212
};
213213

214214
Generator.prototype.herokuCreate = function herokuCreate() {
215-
if(this.name.toLowerCase() != "heroku") return;
215+
if(this.name.toLowerCase() !== "heroku") return;
216216
var done = this.async();
217217

218218
exec('heroku apps:create && heroku config:set NODE_ENV=production', { cwd: 'dist' }, function (err, stdout, stderr) {

0 commit comments

Comments
 (0)