Commit Graph

363 Commits

Author SHA1 Message Date
Juan Cruz Viotti
58713dc291 Add missing yes option to os initialize
This option is tried to be used within the command, but is not defined
as a formal Capitano option.
2015-10-14 17:49:27 -04:00
Juan Cruz Viotti
cddf630907 Avoid _.ary in temporal path disposer
For some reason fails with a weird Bluebird error on Windows
2015-10-12 18:12:58 -04:00
Juan Cruz Viotti
e5e871ddcd Upgrade SDK to v3.0.0
Breaking changes in this version:

- `resin.models.device.generateUUID()` is now async.
2015-10-12 08:34:22 -04:00
Juan Cruz Viotti
f8470287c1 Separate general help per topic relevance
Only list primary commands by default, unless a `--verbose` option is
passed to list the additional ones.

Fixes: https://github.com/resin-io/resin-cli/issues/101
2015-10-02 08:50:32 -04:00
Juan Cruz Viotti
445e37ccaf Call os initialize as an elevated process
Currently, the fact that `os initialize` requires elevated permissions
forced us to require calling commands that reuse it, such as `device
init` and `quickstart` with administrator permissions as well.

This ended up causing issues like saving images in the cache that belong
to root, or initializing git repositories that requires `sudo` to
commit.

The solution is to call `os initialize` as a child process preppending
`sudo` within `device init`.

Fixes: https://github.com/resin-io/resin-cli/issues/109
2015-10-01 13:07:53 -04:00
Juan Cruz Viotti
90be01b05d Make os initialize take a device type instead of a uuid 2015-09-30 14:31:23 -04:00
Juan Cruz Viotti
0443a35f2b Merge pull request #207 from resin-io/jviotti/fix/promise-using
Fix incorrect Promise.using syntax
2015-09-30 12:06:51 -04:00
Juan Cruz Viotti
79d1892b66 Send device type correctly to getManifestBySlug
Currently, we we're sending the wholea device object to
`getManifestBySlug`, which ended up in an unsupported device error.
2015-09-30 11:38:34 -04:00
Juan Cruz Viotti
0e06ac464f Fix incorrect Promise.using syntax
`Promise.using` takes the function that acts on the resource as the
second argument, instead of as `.then()`.
2015-09-30 11:37:27 -04:00
Juan Cruz Viotti
5ae83d8337 Merge pull request #206 from resin-io/jviotti/fix/uncompress-os-download
Uncompress zip packages in os download
2015-09-30 10:48:36 -04:00
Juan Cruz Viotti
8234f7675a Uncompress zip packages in os download
When downloading an operating system image, if the image is a zip
package, uncompress it automatically.
2015-09-30 10:16:24 -04:00
Juan Cruz Viotti
15cb0c4889 Use rimraf for deleting os temporary files
We already use `rimraf` for deleting os temporary directories, however
there are a few benefits of using it for files as well:

- Simplicity. We avoid having to check if a path is a file or directory.
- `rimraf` attempts to workaround the known Windows issues of anti
viruses not closing files. Described in more detail here: https://github.com/resin-io/resin-cli/blob/master/TROUBLESHOOTING.md#i-get-ebusy-errors-after-initializing-a-device-even-as-administrator-on-windows
2015-09-30 10:06:08 -04:00
Juan Cruz Viotti
a3ebd9827f Merge pull request #204 from resin-io/jviotti/fix/console.info
Use console.info in os download
2015-09-30 10:05:19 -04:00
Juan Cruz Viotti
30d84f015a Merge pull request #199 from resin-io/jviotti/feature/197/device-init-apps
Prompt for select application if running device init with no arguments
2015-09-29 15:31:59 -04:00
Juan Cruz Viotti
6377618c12 Use console.info in os download
`console.info` calls can be quieted by the `--quiet` option.
2015-09-29 15:15:39 -04:00
Juan Cruz Viotti
f17e9c97b8 Prompt for select application if running device init with no arguments
Currently, if `device init` was ran without an application argument, we
attempted to get the application name from the current directory, given
it was a git repository.

This approach led to confusions from time to time, so now we prompt the
user to select one of it's own applications from a dropdown instead of
checking the current directory in this edge case.

Fixes: https://github.com/resin-io/resin-cli/issues/197
2015-09-29 15:10:59 -04:00
Juan Cruz Viotti
21fcdfaff6 Use Promise.disposer() to make sure temp files are deleted 2015-09-29 15:08:24 -04:00
Juan Cruz Viotti
d704c10197 Implement os initialize command
This command initialized an operating system image with a disk device.
2015-09-29 14:52:34 -04:00
Juan Cruz Viotti
7e6eb4b9e4 Implement device register command
This command registers a new device with the passed application,
returning the new device uuid.
2015-09-29 14:33:31 -04:00
Juan Cruz Viotti
42256384be Implement os configure
This command, given a path to an image and a device uuid, perform
configuration based on the resin-device-type manifests.
2015-09-29 13:47:10 -04:00
Juan Cruz Viotti
f6d8f12ba2 Implement os download command
This command download an unconfigured image to both the cache and to the
specified location by the `--output` option.
2015-09-29 13:03:14 -04:00
Juan Cruz Viotti
828b4f73d1 Fix selecting existing application in quickstart 2015-09-11 18:30:30 +03:00
Juan Cruz Viotti
64c8420c9d Implement device specs. Fix #99
Support for all devices. Tested in the following ones:

- Intel Edison.
- Raspberry Pi 2.
- Parallella.
2015-09-11 13:02:59 +03:00
Juan Cruz Viotti
79afa79fd9 Use settings from the SDK during login
This enforces all clients to use the Resin Settings Client version that
the SDK provides, reducing incompatibilities caused by different modules
requiring different Resin Settings Client versions.
2015-09-08 09:06:03 +03:00
Juan Cruz Viotti
dc257b5cab Check token validity against the API when login
Consider the following case:

The SDK is configured to point to staging, but the user passes a token
from production, or viceversa. Since the token is valid in a sense that
is valid JWT and contains real data, the CLI will report as a success.

The user will then get Unauthorized errors when using the API.
2015-09-05 20:17:34 +03:00
Juan Cruz Viotti
4bdcd3d2ee Merge pull request #180 from resin-io/issue_#103
Resin CLI Events integration. Fix #103
2015-09-05 20:11:52 +03:00
mike
b0650530cc Resin CLI Events integration. Fix #103 2015-09-05 19:15:31 +03:00
mike
8c3e832cdc Replace device name with uuid in env-variables command example 2015-09-01 00:56:01 +03:00
Juan Cruz Viotti
a090e6c21d Refactor quickstart
- Use promises.
- Move some logic to `helpers`.
- Inline `device await` command.
2015-08-27 10:01:33 -04:00
Juan Cruz Viotti
354921ca92 Add Aborted error message when not accepting a confirmation
This prevents a lot of duplicate code to check for confirmation status
and exit from the current action.
2015-08-20 16:16:20 -04:00
Juan Cruz Viotti
dc513a08f6 Update Resin CLI Form to v1.2.0
This version includes support for the `drive` input type.
2015-08-20 11:55:53 -04:00
Juan Cruz Viotti
a803d4f646 Remove plugins manipulation commands
Since we're now forcing users to rely on `npm` directly for updates, we
can also get rid of plugin commands that attempt to
install/update/remove using npm programatically and require users to use
`npm` directly as well.

This commit removes the following commands:

- `plugins`
- `plugin install`
- `plugin update`
- `plugin remove`

Despite plugin related commands being removed, *the functionality that
scans for plugins and registers them remains intact*.
2015-08-19 10:57:42 -04:00
mike
019e2ac357 Display msg when app/device does not have env variables. Fix #166 2015-08-18 18:12:08 +03:00
mike
0595452c3d Add message informing the user about potential delay in system img initialization. Fix #90. 2015-08-18 15:43:52 +03:00
Michalis Korakakis
d6305df48e Merge pull request #163 from resin-io/issue-108
Reword ending message in quickstart. Fix #108
2015-08-18 15:00:38 +03:00
mike
3dd5f5858a Reword ending message in quickstart. Fix #108 2015-08-18 14:34:15 +03:00
mike
02a06e1e7c Reword output during download in device init. Fix #106. 2015-08-18 13:55:04 +03:00
Juan Cruz Viotti
fd5a34a1c4 Refactor env action module to use promises 2015-08-17 10:32:22 -04:00
Juan Cruz Viotti
a698b25fda Remove devices supported command
The command is not necessary and unused.
2015-08-17 10:05:36 -04:00
Juan Cruz Viotti
89bd861d8e Merge pull request #159 from resin-io/jviotti/refactor/device
Refactor device actions to use promises
2015-08-17 10:03:57 -04:00
Juan Cruz Viotti
e5b7aae4ae Refactor device actions to use promises 2015-08-17 09:49:59 -04:00
Juan Cruz Viotti
09a5788902 Refactor keys action to use promises 2015-08-17 09:32:05 -04:00
Juan Cruz Viotti
f63391acf9 Make use of projectsDirectory SDK setting in Quickstart
We were currently building this path ourselves, hardcoding the place of
the resin local per user directory instead of relying on the foundations
that `resin-settings-client` give us.
2015-08-17 09:06:27 -04:00
Juan Cruz Viotti
70c060b124 Refactor auth actions to use promises 2015-08-17 08:22:48 -04:00
Juan Cruz Viotti
7a8a3c851b Merge pull request #138 from resin-io/refactor/help
Refactor help module
2015-08-17 08:02:15 -04:00
Juan Cruz Viotti
1096b2d212 Merge pull request #143 from resin-io/jviotti/refactor/app
Refactor app actions to use promises
2015-08-17 08:02:04 -04:00
Juan Cruz Viotti
ee286c5690 Merge pull request #144 from resin-io/jviotti/refactor/note
Refactor note set command to use promises
2015-08-17 08:01:47 -04:00
Juan Cruz Viotti
1da1d2e6fc Merge pull request #152 from resin-io/jviotti/fix/151/ssh-key-list
Print ssh key separately from the information table
2015-08-17 08:01:32 -04:00
Juan Cruz Viotti
30f24333c0 Implement a spinner when awaiting for a device. Fix #107
Fixes:

- https://github.com/resin-io/resin-cli/issues/107
2015-08-14 14:35:38 -04:00
Juan Cruz Viotti
8c9a0e0ff1 Fix broken device await command
There were two issues that prevented this command from working
correctly:

1- `Promise.delay()` is used, but `Promise` was not imported.
2- The following line had incorrect indentation (spaces instead of
		tabs):

		poll().nodeify(done)

Therefore CoffeeScript interpreted that the line had to be executed at
the end of the `poll()` function, causing `poll()` to never be called.
2015-08-14 14:11:49 -04:00