From 3005a916582074b3d57f453927651ced5fb17d9a Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 5 Feb 2015 09:56:22 -0400 Subject: [PATCH] Write device init help page --- lib/actions/device.coffee | 26 ++++++++++++++++++++++++-- lib/helpers/helpers.coffee | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/actions/device.coffee b/lib/actions/device.coffee index e8ca67f5..0dd40e69 100644 --- a/lib/actions/device.coffee +++ b/lib/actions/device.coffee @@ -142,9 +142,31 @@ exports.init = signature: 'device init [device]' description: 'initialise a device with resin os' help: ''' - Device init. + Use this command to download the OS image of a certain application and write it to an SD Card. - TODO: Help page + Note that this command requires admin privileges. + + If `device` is omitted, you will be prompted to select a device interactively. + + Notice this command asks for confirmation interactively. + You can avoid this by passing the `--yes` boolean option. + + You can quiet the progress bar by passing the `--quiet` boolean option. + + You may have to unmount the device before attempting this operation. + + You need to configure the network type and other settings: + + Ethernet: + You can setup the device OS to use ethernet by setting the `--network` option to "ethernet". + + Wifi: + You can setup the device OS to use wifi by setting the `--network` option to "wifi". + If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well. + + Examples: + $ resin device init --application 91 --network ethernet + $ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret ''' options: [ commandOptions.application diff --git a/lib/helpers/helpers.coffee b/lib/helpers/helpers.coffee index 658cf220..920cf0c9 100644 --- a/lib/helpers/helpers.coffee +++ b/lib/helpers/helpers.coffee @@ -1,3 +1,4 @@ +os = require('os') _ = require('lodash') getStdin = require('get-stdin')