Skip to content

Commit

Permalink
Merge pull request #146 from dhis2/pretty-print
Browse files Browse the repository at this point in the history
feat(pretty-print): add a helper to print relative paths
  • Loading branch information
varl authored Dec 7, 2021
2 parents d6dd5bd + 03efc09 commit ed56b2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports.exec = require('./lib/exec.js')
module.exports.reporter = require('./lib/reporter')
module.exports.exit = require('./lib/exit.js')
module.exports.prompt = require('./lib/prompt')
module.exports.prettyPrint = require('./lib/prettyPrint.js')

// Access to wrapped libraries
module.exports.chalk = require('chalk')
Expand Down
3 changes: 3 additions & 0 deletions lib/prettyPrint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const path = require('path')
exports.relativePath = (fp, cwd = process.cwd()) =>
path.isAbsolute(fp) ? path.relative(cwd, fp) : fp

0 comments on commit ed56b2b

Please sign in to comment.