2014-11-19 12:59:17 +00:00
|
|
|
open = require('open')
|
2014-12-01 14:11:00 +00:00
|
|
|
url = require('url')
|
2015-01-08 12:04:37 +00:00
|
|
|
resin = require('resin-sdk')
|
2014-12-12 21:20:29 +00:00
|
|
|
permissions = require('../permissions/permissions')
|
2014-11-19 12:59:17 +00:00
|
|
|
|
2015-01-15 17:10:14 +00:00
|
|
|
exports.preferences =
|
|
|
|
signature: 'preferences'
|
|
|
|
description: 'open preferences form'
|
|
|
|
help: '''
|
|
|
|
Use this command to open the preferences form.
|
|
|
|
|
|
|
|
In the future, we will allow changing all preferences directly from the terminal.
|
|
|
|
For now, we open your default web browser and point it to the web based preferences form.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
$ resin preferences
|
|
|
|
'''
|
|
|
|
action: permissions.user ->
|
|
|
|
preferencesUrl = resin.settings.get('urls.preferences')
|
|
|
|
absUrl = url.resolve(resin.settings.get('remoteUrl'), preferencesUrl)
|
|
|
|
open(absUrl)
|