Skip to content

Commit ddc8e64

Browse files
committed
Better support for temp directories.
1 parent bf61971 commit ddc8e64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
var path = require( "path" ),
2+
tmpDir = process.env.TMPDIR || process.env.TMP || process.env.TEMP ||
3+
( process.platform === "win32" ? "c:/windows/temp" : "/tmp" ),
24
config = require( process.env.JQ_PATH ?
35
process.env.JQ_PATH + "/plugins.jquery.com" :
46
"../config" );
57

6-
console.log( config.test );
78
function resolvePath( key, _default ) {
89
config[ key ] = path.resolve( __dirname, "..", config[ key ] || _default );
910
}
1011

11-
resolvePath( "repoDir", "/tmp/plugin-repos" );
12+
resolvePath( "repoDir", path.resolve( tmpDir, "plugin-repos" ) );
1213
resolvePath( "pluginsDb", "plugins.db" );
1314

1415
module.exports = config;

0 commit comments

Comments
 (0)