Files

21 lines
484 B
JavaScript
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
var fs = require('fs');
var eachSeries = require('async/eachSeries');
module.exports = function(folder, cb) {
if (folder[folder.length - 1] !== '/')
folder += '/';
eachSeries(['git', 'hg', 'svn'],
function(type, callback) {
fs.exists(folder+'.'+type, function(exists) {
if (exists)
return callback(type);
else
return callback();
});
},
function(final) {
return cb(final ? final : 'No versioning system found', folder);
});
};