preons
Version:
Functional css library and utility belt
13 lines (12 loc) • 312 B
JavaScript
/**
* Gets the absolute path from provided path relative to command exection directory.
*
* @param {string} path - Path of file or directory.
* @returns {string}
*/
module.exports.getAbsolute = (path) => {
if (path.indexOf("/") === 0) {
return path
}
return `${process.cwd()}/${path}`
}