UNPKG

@coat/cli

Version:

TODO: See #3

21 lines (20 loc) 764 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRelativeFilePath = getRelativeFilePath; var _path = _interopRequireDefault(require("path")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Returns the path of a file relative * to the root coat project directory. * Results will always use unix style "/" path separators. * * @param filePath The file path to retrieve the relative path * @param context The context of the current coat project */ function getRelativeFilePath(filePath, context) { return _path.default.relative(context.cwd, filePath) // File paths should always use forward slashes .split(_path.default.sep).join(_path.default.posix.sep); }