mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-12 07:52:46 +00:00
17 lines
354 B
CoffeeScript
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
|