Skip to content

Commit 3d637ca

Browse files
committed
[OS independent] Use path.join
Signed-off-by: Eric Wang <[email protected]>
1 parent 095aab5 commit 3d637ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/helper.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ h.getHomeDir = function() {
113113
};
114114

115115
h.getCacheDir = function() {
116-
return this.getHomeDir() + '/.lc/';
116+
return path.join(this.getHomeDir(), '.lc');
117117
};
118118

119119
h.getCacheFile = function(k) {
120-
return this.getCacheDir() + k + '.json';
120+
return path.join(this.getCacheDir(), k + '.json');
121121
};
122122

123123
h.getConfigFile = function() {
124-
return this.getHomeDir() + '/.lcconfig';
124+
return path.join(this.getHomeDir(), '.lcconfig');
125125
};
126126

127127
h.readStdin = function(cb) {

test/test_helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('helper', function() {
129129
process.env.HOME = '/home/skygragon';
130130

131131
assert.equal(h.getHomeDir(), '/home/skygragon');
132-
assert.equal(h.getCacheDir(), '/home/skygragon/.lc/');
132+
assert.equal(h.getCacheDir(), '/home/skygragon/.lc');
133133
assert.equal(h.getCacheFile('xxx'), '/home/skygragon/.lc/xxx.json');
134134
assert.equal(h.getConfigFile(), '/home/skygragon/.lcconfig');
135135
assert.equal(h.getFilename('/home/skygragon/.lc/xxx.json'), 'xxx');

0 commit comments

Comments
 (0)