balena-cli/lib/resin/helpers/helpers.coffee
2014-12-03 12:03:54 -04:00

17 lines
354 B
CoffeeScript

_ = require('lodash')
path = require('path')
exports.isAbsolutePath = (p) ->
return path.resolve(p) is p
exports.prefixObjectValuesWithPath = (prefix, object) ->
return _.object _.map object, (value, key) ->
result = [ key ]
if exports.isAbsolutePath(value)
result.push(value)
else
result.push(path.join(prefix, value))
return result