dotfiles/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/create-pipes.js
Cyryl Płotnicki 280bcab25f VSCode update
2016-09-24 13:12:34 +02:00

31 lines
777 B
JavaScript

// Generated by CoffeeScript 1.9.3
(function() {
var fs, timeout;
fs = require('fs');
timeout = require('./timeout');
module.exports = function() {
var created, dir, i, len, name, ref, t_limit, tmp_dir;
t_limit = Date.now() + 1000;
tmp_dir = '/tmp';
ref = ['TMPDIR', 'TMP', 'TEMP'];
for (i = 0, len = ref.length; i < len; i++) {
name = ref[i];
if ((dir = process.env[name]) != null) {
tmp_dir = dir.replace(/\/$/, '');
}
}
while (!created) {
try {
dir = tmp_dir + '/sync-exec-' + Math.floor(Math.random() * 1000000000);
fs.mkdir(dir);
created = true;
} catch (_error) {}
timeout(t_limit, 'Can not create sync-exec directory');
}
return dir;
};
}).call(this);