3346 Commits

Author SHA1 Message Date
Juan Cruz Viotti
cb4798e0a5 Add support for XZ compressed images (#376)
This PR introduces `etcher-image-stream`:

https://github.com/resin-io-modules/etcher-image-stream

a module that will handle support for decompression, URL streaming, and
any other way to get a source of data to write in Etcher.

Most of the changes in this PR are because XZ decompression includes a
native dependency (no pure JS implementations out there for now), so we
had to tweak various things for the dependency to work correctly on
Etcher/Electron.

See: https://github.com/resin-io/etcher/issues/325
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-04 02:07:43 -04:00
Juan Cruz Viotti
5575cb1af8 Revert "Implement writing by spawning the CLI as a child process (#385)" (#394)
This reverts commit fab2d767b0ae6b0401b428910096af236897973d.
2016-05-04 01:57:26 -04:00
Juan Cruz Viotti
ccef599bcf Fix application not being elevated in Windows (#393)
After elevation routine refactoring, it looks like we have to exit the
parent process after a short while, otherwise it kills the app before
the elevated child process is executed.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-04 01:35:19 -04:00
Juan Cruz Viotti
369e38b310 Improve "Select Image" supported file types label with a tooltip (#392)
Fixes: https://github.com/resin-io/etcher/issues/378
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-04 01:30:54 -04:00
Juan Cruz Viotti
5d45ceade7 Add Python as a PUBLISHING pre-requisite (#391)
This is needed to build native NodeJS addons.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-03 19:45:03 -04:00
Juan Cruz Viotti
7d254160c5 Show the forked command as a debug analytics message (#388)
This is very useful for debugging.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-02 10:01:50 -04:00
Juan Cruz Viotti
fab2d767b0 Implement writing by spawning the CLI as a child process (#385)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 13:01:06 -04:00
Juan Cruz Viotti
d52f948e46 Use correct exit codes when running Etcher CLI with --robot (#384)
Currently, the exit codes documented in the help section was not
honoured if the CLI was ran with the `--robot` option. In this case, the
CLI would exit with code 0 even if the validation failed.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 12:30:09 -04:00
Juan Cruz Viotti
087a008d0d Make sure CLI args are parsed correctly when spawning in OS X (#383)
The binary used when spawning the CLI in OS X during development is
`electron-prebuilt/disk/Electron.app/Contents/MacOS/Electron`.

To make sure we catch both `Electron` and `electron`, make the
executable name lowercase before comparing it.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 11:55:23 -04:00
Juan Cruz Viotti
36bd696da9 Make use of etcher-image-write (#382)
This is the new name of the older `resin-image-write` dependency.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 09:45:52 -04:00
Juan Cruz Viotti
ad758cf391 Implement Etcher.OS.Dialog module (#381)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 09:03:20 -04:00
Juan Cruz Viotti
d373d32472 Move README "Developing" section to CONTRIBUTING.md (#380)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 09:03:15 -04:00
Juan Cruz Viotti
bd410bd88c Document exit codes in Etcher CLI help (#379)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-29 09:03:08 -04:00
Juan Cruz Viotti
ba9598be1a Upgrade resin-image-write to v4.0.1 (#377)
This new version contains a fix to align unaligned images and prevent
`EINVAL` errors.

Fixes: https://github.com/resin-io/etcher/issues/348
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-28 09:27:38 -04:00
Juan Cruz Viotti
10615b0899 Include lib/cli in final package (#372)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-27 15:23:46 -04:00
Juan Cruz Viotti
f8b66b317a Escape leading periods on packageignore list (#373)
Otherwise, the `.` is interpreted as a period in a regular expression,
  which matches every literal character, causing some packages deep in
  the `node_modules/` hierarchy to be ignored for no reason.

For example, if we ignore `.git`, then a package like `foo-git` will be
excluded from the final package.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-27 14:24:55 -04:00
Juan Cruz Viotti
1de3d7b26c Make sure the CLI handles arguments correctly when being packaged (#374)
The CLI now attempts to detect whether it is being run as an argument to
a JavaScript runner (like node or electron), or as a final packaged
executable by applying some heuristics on the first argument.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-27 14:24:49 -04:00
Juan Cruz Viotti
d7ce744e26 Document that ELECTRON_RUN_AS_NODE doesn't load app.asar by default (#375)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-27 14:24:32 -04:00
Juan Cruz Viotti
e7760e253f Lock electron development version, and re-use it in Makefile (#371)
By locking the electron version in `package.json`, we can require it
from the Makefile to ensure production and development are both running
the exact same electron version, and ensures they don't easily get out
of sync.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-27 11:48:35 -04:00
Juan Cruz Viotti
a88cab2eb1 Update top-level screenshot (#370)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 13:57:25 -04:00
Juan Cruz Viotti
d80da9f7ce Move Etcher CLI exit code definitions to lib/src (#369)
The purpose is that defined exit codes can be reused in the GUI, so they
are kept in sync more easily.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 13:40:44 -04:00
Juan Cruz Viotti
3af8d4d4a2 Upgrade resin-image-write to v4.0.0 (#368)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 13:33:39 -04:00
Juan Cruz Viotti
ccae6bf783 Prefix robot progress state output with "progress" (#367)
This makes it a bit easier to determine if a `stdout` line is a progress
state or not, rather than checking for both `write` or `check`.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 12:30:06 -04:00
Juan Cruz Viotti
1dbe707700 Upgrade node-umount to v1.1.3 (#366)
This new version contains a fix where the `diskutil` command was not
found on certain OS X setups.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 12:16:30 -04:00
Juan Cruz Viotti
4a856d24df Add entry point file to decide between GUI/CLI (#365)
This file runs the Etcher CLI if the binary was ran with
`ELECTRON_RUN_AS_NODE`, or the GUI otherwise.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 11:39:15 -04:00
Juan Cruz Viotti
bb4ad6a042 Add an option to control unmounting on success in Etcher CLI (#362)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 09:38:29 -04:00
Juan Cruz Viotti
3fdf41693a Upgrade sudo-prompt to v3.1.0 (#364)
Fixes: https://github.com/resin-io/etcher/issues/289
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-26 09:38:24 -04:00
Juan Cruz Viotti
ba68892bd3 Upgrade outdated dependencies (#363)
- `electron-mocha`
- `electron-packager`

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 16:04:32 -04:00
Juan Cruz Viotti
8bdc089de4 Implement validation support in Etcher CLI (#361)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 15:47:05 -04:00
Juan Cruz Viotti
86cbff940c Implement Etcher CLI "robot" option (#360)
This option makes the Etcher CLI outputs state information in a way that
can be easily parsed by a parent process spawning it.

The format of the state output is:

  <type> <percentage>% <eta>s <speed>

This can be easily parsed as follows:

  const output = line.split(' ');

  const state = {
    type: output[0],
    percentage: parseInt(output[1], 10),
    eta: parseInt(output[2], 10),
    speed: parseInt(output[3], 10)
  };

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 14:50:34 -04:00
Juan Cruz Viotti
f55100d09b Fix lint warnings (#359)
- `os` in unused in `byte-size.spec.js`

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 14:50:23 -04:00
Juan Cruz Viotti
d5b3e0a83f Upgrade drivelist to v3.0.0 (#354)
This new version reports the size as a number of bytes instead of a
human readable string, so we have to take care of converting back to a
readable GB format ourselves.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 12:46:59 -04:00
Juan Cruz Viotti
afeba11424 Move GUI code into lib/gui (#358)
This refactoring will be useful on future changes, where there will be
a single application entry point that will execute the CLI or the GUI
version depending on the environment.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 12:08:19 -04:00
Juan Cruz Viotti
0ac79fa251 Deprecate tar.gz GNU/Linux "installers" (#356)
We're distributing AppImages now for convenience.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-25 11:44:50 -04:00
Juan Cruz Viotti
5bc5b42d3a v1.0.0-beta.4
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
v1.0.0-beta.4
2016-04-22 13:11:11 -04:00
Juan Cruz Viotti
1ac0fae405 Fix Error: Cannot find module ../global-shortcut in Windows (#353)
Since the Electron upgrade, Windows users are hitting a weird error
about `global-shortcut` not existing.

A solution is to `require('global-shortcut')` instead of accessing it as
a property of `electorn`.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-22 13:03:46 -04:00
Juan Cruz Viotti
2fdad8adcb Highlight features in README file (#301)
Fixes: https://github.com/resin-io/etcher/issues/291
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-21 10:49:20 -04:00
Juan Cruz Viotti
dcff257f20 Upgrade Electron to v0.37.6 (#350)
* Upgrade Electron to v0.37.6

The main motiviation for such upgrade is that an error manifesting
itself as `Cannot read property 'object' of undefined` on certain Linux
systems was fixed in v0.37.4.

See https://github.com/electron/electron/issues/5229
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Make use of shell module by requiring `shell`

Otherwise we get a strange issue when trying to stub it:

    TypeError: Attempted to wrap undefined property openExternal as function

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-21 10:26:29 -04:00
Juan Cruz Viotti
148b9d15ae Integrate Etcher CLI in the main repository (#352)
This PR integrates the Etcher CLI code-wise, but doesn't yet handles the
distribution part of the story.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-21 10:08:53 -04:00
Juan Cruz Viotti
a462ee86c0 Add Makefile rule to generate an x86 AppImage for GNU/Linux (#349)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-21 09:01:34 -04:00
Juan Cruz Viotti
4d70676612 Distinguish between flash and validation events in Mixpanel (#347)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-20 14:56:58 -04:00
Juan Cruz Viotti
f683b841fa Make use of AppImage desktop integration script (#346)
This is useful to prompt the user to install the `.desktop` file.

The `Description` key in `Etcher.desktop` was changed to `Comment` since
`desktop-file-validate` complained with:

    Etcher.desktop: error: file contains key "Description" in group "Desktop
    Entry", but keys extending the format should start with "X-"

After checking the desktop file format specification, the correct key
should be "Comment"
(https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s05.html).

See: bc6e519964 (commitcomment-17164442)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 16:29:16 -04:00
Juan Cruz Viotti
bc6e519964 Generate AppImage package for GNU/Linux x86_64 (#345)
Fixes: https://github.com/resin-io/etcher/issues/323
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 13:29:32 -04:00
Juan Cruz Viotti
975c949fdf Allow to bypass elevation with an environment variable (#343)
This is mostly used for debugging purposes, or by power users that know
what they're doing.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 11:07:59 -04:00
Juan Cruz Viotti
fdf28cdf5f Remove unnecessary fields from bower.json. (#342)
We don't distribute the application through bower, and removing stuff
means one less place to be concerned about certain meta-data to be in
sync.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 10:01:26 -04:00
Juan Cruz Viotti
ed70e4e590 Refactor initial elevation routine (#341)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-19 09:40:25 -04:00
Juan Cruz Viotti
284f2a0ebb Add dashed underline to footer links (#340)
Fixes: https://github.com/resin-io/etcher/issues/338
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-18 13:16:26 -04:00
Juan Cruz Viotti
5baf8e5407 Improve UX when closing the drive selector modal (#339)
The current "Close" button makes it confusing to the user to know if
he's accepting his changes, or just discarding them.

The "Close" button in the top right corner was replaced with a standard
cross icon, and there is a new "Continue" block button fixed in the
bottom of the modal.

Fixes: https://github.com/resin-io/etcher/issues/294
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-18 13:16:17 -04:00
Juan Cruz Viotti
35ac745452 Link the version string in the footer to the CHANGELOG (#337)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-18 12:39:18 -04:00
Juan Cruz Viotti
ed592f0597 Add application version to footer (#335)
* Implement ManifestBind directive

This directive is useful to bind the contents of an element to a
property in the `package.json` manifest.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>

* Add application version to footer

Fixes: https://github.com/resin-io/etcher/issues/292
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-04-17 23:57:56 -04:00