Merge pull request #157 from resin-io/jviotti/feature/settings-projects-dir

Make use of `projectsDirectory` SDK setting in Quickstart
This commit is contained in:
Juan Cruz Viotti 2015-08-17 09:20:30 -04:00
commit 713664d103
3 changed files with 12 additions and 18 deletions

View File

@ -1,5 +1,5 @@
(function() {
var Promise, _, async, capitano, form, mkdirp, path, resin, userHome, visuals;
var Promise, _, async, capitano, form, mkdirp, resin, visuals;
_ = require('lodash');
@ -7,12 +7,8 @@
capitano = Promise.promisifyAll(require('capitano'));
path = require('path');
mkdirp = require('mkdirp');
userHome = require('user-home');
visuals = require('resin-cli-visuals');
async = require('async');
@ -86,10 +82,12 @@
return capitano.run("device " + params.uuid, callback);
}, function(callback) {
console.log('Your device is ready, lets start pushing some code!');
return form.ask({
message: 'Please choose a directory for your code',
type: 'input',
"default": path.join(userHome, 'ResinProjects', params.name)
return resin.settings.get('projectsDirectory').then(function(projectsDirectory) {
return form.ask({
message: 'Please choose a directory for your code',
type: 'input',
"default": projectsDirectory
});
}).nodeify(callback);
}, function(directoryName, callback) {
params.directory = directoryName;

View File

@ -1,9 +1,7 @@
_ = require('lodash')
Promise = require('bluebird')
capitano = Promise.promisifyAll(require('capitano'))
path = require('path')
mkdirp = require('mkdirp')
userHome = require('user-home')
visuals = require('resin-cli-visuals')
async = require('async')
resin = require('resin-sdk')
@ -97,12 +95,11 @@ exports.wizard =
(callback) ->
console.log('Your device is ready, lets start pushing some code!')
form.ask
message: 'Please choose a directory for your code'
type: 'input'
# TODO: Move this to resin-settings-client.
default: path.join(userHome, 'ResinProjects', params.name)
resin.settings.get('projectsDirectory').then (projectsDirectory) ->
form.ask
message: 'Please choose a directory for your code'
type: 'input'
default: projectsDirectory
.nodeify(callback)
(directoryName, callback) ->

View File

@ -62,7 +62,6 @@
"resin-vcs": "^2.0.0",
"selfupdate": "^1.1.0",
"underscore.string": "^3.1.1",
"user-home": "^2.0.0",
"valid-email": "0.0.2"
}
}