Merge branch 'master' of github.com:resin-io/resin-cli

This commit is contained in:
Juan Cruz Viotti 2015-05-11 13:08:44 -03:00
commit 679d48e86e
3 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
(function() {
var _, async, capitano, commandOptions, elevate, image, mkdirp, npm, os, packageJSON, path, resin, visuals;
var _, async, capitano, commandOptions, elevate, image, mkdirp, npm, os, packageJSON, path, resin, umount, visuals;
capitano = require('capitano');
@ -19,6 +19,8 @@
visuals = require('resin-cli-visuals');
umount = require('umount').umount;
commandOptions = require('./command-options');
npm = require('../npm');
@ -131,10 +133,12 @@
message = "This will completely erase " + params.device + ". Are you sure you want to continue?";
return visuals.patterns.confirm(options.yes, message, callback);
}, function(confirmed, callback) {
var bar;
if (!confirmed) {
return done();
}
return umount(params.device, _.unary(callback));
}, function(callback) {
var bar;
bar = new visuals.widgets.Progress('Writing Device OS');
params.progress = _.bind(bar.update, bar);
return image.write(params, callback);

View File

@ -7,6 +7,7 @@ mkdirp = require('mkdirp')
resin = require('resin-sdk')
image = require('resin-image')
visuals = require('resin-cli-visuals')
umount = require('umount').umount
commandOptions = require('./command-options')
npm = require('../npm')
packageJSON = require('../../package.json')
@ -155,6 +156,9 @@ exports.install =
(confirmed, callback) ->
return done() if not confirmed
umount(params.device, _.unary(callback))
(callback) ->
bar = new visuals.widgets.Progress('Writing Device OS')
params.progress = _.bind(bar.update, bar)
image.write(params, callback)

View File

@ -66,6 +66,7 @@
"resin-settings-client": "^1.0.0",
"resin-vcs": "^1.2.0",
"tmp": "^0.0.25",
"umount": "^1.0.0",
"underscore.string": "~2.4.0",
"update-notifier": "^0.3.1"
}