Skip to content

Commit

Permalink
fix a miserable error removing functions... which is mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 10, 2016
1 parent 9ab1227 commit bd9e46b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/cli/core/utils/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ export function changePath(pathEnv, change) {

return path.join(config.root, pathEnv.join('/'))
}

/**
* This method checks that the path leads to a file and return the content as UTF-8 content
* @param {string} path The path
* @return {string} The content of the UTF-8 file
*/
export function getContent(pathFile) {
var res = null
if(typeof pathFile !== 'undefined' && pathFile !== null && pathFile !== '') {
if (exist(pathFile)) {
res = fse.readFileSync(pathFile, 'utf8')
}
}
return res
}

0 comments on commit bd9e46b

Please sign in to comment.