From 79d1892b66ed093366eb55a55fded88c69b68998 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 30 Sep 2015 11:38:34 -0400 Subject: [PATCH] Send device type correctly to getManifestBySlug Currently, we we're sending the wholea device object to `getManifestBySlug`, which ended up in an unsupported device error. --- build/actions/os.js | 2 +- lib/actions/os.coffee | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/actions/os.js b/build/actions/os.js index ce201091..6bb40a73 100644 --- a/build/actions/os.js +++ b/build/actions/os.js @@ -104,7 +104,7 @@ permission: 'user', action: function(params, options, done) { console.info('Initializing device'); - return resin.models.device.get(params.uuid).then(resin.models.device.getManifestBySlug).then(function(manifest) { + return resin.models.device.get(params.uuid).get('device_type').then(resin.models.device.getManifestBySlug).then(function(manifest) { var ref; return (ref = manifest.initialization) != null ? ref.options : void 0; }).then(form.run).tap(function(answers) { diff --git a/lib/actions/os.coffee b/lib/actions/os.coffee index 88e374cf..94e041a0 100644 --- a/lib/actions/os.coffee +++ b/lib/actions/os.coffee @@ -108,6 +108,7 @@ exports.initialize = action: (params, options, done) -> console.info('Initializing device') resin.models.device.get(params.uuid) + .get('device_type') .then(resin.models.device.getManifestBySlug) .then (manifest) -> return manifest.initialization?.options