balena-cli/lib/actions/notes.coffee

18 lines
435 B
CoffeeScript

async = require('async')
permissions = require('../permissions/permissions')
helpers = require('../helpers/helpers')
resin = require('resin-sdk')
exports.set = permissions.user (params, options, done) ->
async.waterfall([
(callback) ->
if not params.note?
return helpers.readStdin(callback)
return callback(null, params.note)
(note, callback) ->
resin.models.device.note(options.device, note, callback)
], done)