mirror of
https://github.com/bower/bower.git
synced 2026-01-14 16:57:57 -05:00
15 lines
358 B
JavaScript
15 lines
358 B
JavaScript
var path = require('path');
|
|
var isPathAbsolute = require('./isPathAbsolute');
|
|
|
|
function relativeToBaseDir(baseDir) {
|
|
return function (filePath) {
|
|
if (isPathAbsolute(filePath)) {
|
|
return path.resolve(filePath);
|
|
} else {
|
|
return path.resolve(baseDir, filePath);
|
|
}
|
|
};
|
|
}
|
|
|
|
module.exports = relativeToBaseDir;
|