mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 18:56:25 +00:00
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:
commit
713664d103
@ -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;
|
||||
|
@ -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) ->
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user