Skip to content

Commit 4d61650

Browse files
committed
rename from path to fs for exists
1 parent 9aaa89e commit 4d61650

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

helpers/fs_helper.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ var path = require('path'),
44
config = require('../config/config');
55
exec = require('child_process').exec;
66

7+
fs.exists || (fs.exists = path.exists);
8+
79
/*
810
* Checks to see if a bitbucket ssh key exists already.
911
*/
1012
exports.has_ssh_key = function has_ssh_key(cb) {
11-
path.exists(process.env['HOME'] + '/.ssh/id_rsa_bitbucket.pub', function(exists) {
13+
fs.exists(process.env['HOME'] + '/.ssh/id_rsa_bitbucket.pub', function(exists) {
1214
if (exists) {
1315
cb(true);
1416
} else {
@@ -43,8 +45,8 @@ exports.generate_ssh_key = function(cb) {
4345
exports.append_to_ssh_config = function append_to_ssh_config(cb) {
4446
var ssh_config_file = process.env['HOME'] + '/.ssh/config';
4547
var identity_info = "Host bitbucket.org \r\n\tHostName bitbucket.org\r\n\tStrictHostKeyChecking no\r\n\tPreferredAuthentications publickey\r\n\tIdentityFile ~/.ssh/id_rsa_bitbucket";
46-
47-
path.exists(ssh_config_file, function(exists) {
48+
49+
fs.exists(ssh_config_file, function(exists) {
4850
if (exists) {
4951
//file exists, let's check if it has the bitbucket host in it, otherwise add it
5052
fs.readFile(ssh_config_file, 'ascii', function(err, data) {
@@ -170,4 +172,4 @@ exports.create_project_gitignore = function(cb) {
170172
});
171173

172174
});
173-
};
175+
};

0 commit comments

Comments
 (0)