summaryrefslogtreecommitdiffstats
path: root/lib/utils/path.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/path.js')
-rw-r--r--lib/utils/path.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/utils/path.js b/lib/utils/path.js
index f195d6c..c233c92 100644
--- a/lib/utils/path.js
+++ b/lib/utils/path.js
@@ -42,8 +42,17 @@ function resolveInRoot(root) {
return result;
}
+// Chnage extension
+function setExtension(filename, ext) {
+ return path.join(
+ path.dirname(filename),
+ path.basename(filename, path.extname(filename)) + ext
+ );
+}
+
module.exports = {
isInRoot: isInRoot,
resolveInRoot: resolveInRoot,
- normalize: normalizePath
+ normalize: normalizePath,
+ setExtension: setExtension
};