503 Commits

Author SHA1 Message Date
Juan Cruz Viotti
c93f528f96 upgrade: drivelist to v5.0.16 (#1160)
See: https://github.com/resin-io-modules/drivelist/pull/150
Fixes: https://github.com/resin-io/etcher/issues/1159
Change-Type: patch
Changelog-Entry: Fix GNU/Linux udev error when `net.ifnames` is set.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-07 10:44:34 -04:00
Juan Cruz Viotti
10c5e57b98 upgrade: etcher-image-write to v9.0.1 (#1157)
We're particularly interested in:

- https://github.com/resin-io-modules/etcher-image-write/pull/84

Which fixes ENOSPC alignment issues.

This new version upgrades all its dependencies, which is the reason why
`npm-shrinkwrap.json` contains a lot of changes.

Fixes: https://github.com/resin-io/etcher/issues/1109
Change-Type: patch
Changelog-Entry: Fix `ENOSPC` image alignment errors.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-06 14:22:03 -04:00
Juan Cruz Viotti
c2a27301b7 upgrade drivelist to v5.0.15 (#1158)
We're mainly interested in the following change:

- https://github.com/resin-io-modules/drivelist/pull/148

Fixes: https://github.com/resin-io/etcher/issues/1126
Change-Type: patch
Changelog-Entry: Fix errors when unplugging drives exactly when the drive scanning scripts are running.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-06 13:52:39 -04:00
Juan Cruz Viotti
be001cc266
v1.0.0-beta.19
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-24 15:15:14 -04:00
Juan Cruz Viotti
d845cccff5 upgrade: drivelist to v5.0.14 (#1130)
See: https://github.com/resin-io-modules/drivelist/pull/146
Change-Type: patch
Changelog-Entry: Don't ignore errors coming from the Windows drive detection script.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-24 10:51:40 -04:00
Juan Cruz Viotti
0db335c8f1 chore: start codespell dictionary file in the root of the project (#1087)
codespell works by having a dictionary of pairs of malformed words and
their correct equivalents. This means that codespell will not catch most
issues out of the box, but we can train it based on the common spelling
issues we encounter along the way.

The plan is to add a pair to `dictionary` every time we encounter a typo
during a code review, and we ensure that error will not happen again
anymore.

See: https://github.com/resin-io/etcher/pull/1084
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-23 14:56:43 -04:00
Juan Cruz Viotti
b6c6e94448 upgrade: drivelist to v5.0.13 (#1123)
This version fixes an `EACCES` issue when spawning the platform scripts
in OS X and GNU/Linux, which caused because previous versions were
published to NPM from Windows, and Windows seems to mess up the file
permissions (the execution bit in this particular case).

I'm not adding a changelog entry given this issue happen on `master` and
didn't affect any release.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-22 15:46:25 -04:00
Juan Cruz Viotti
d9a92a63ee upgrade: drivelist to v5.0.11 (#1117)
Change-Type: patch
Changelog-Entry: Omit empty SD Card readers in the drive selector on Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-20 09:26:11 -04:00
Juan Cruz Viotti
98f8c3f87f upgrade: drivelist to v5.0.10 (#1101)
This version contains a fix to omit drive letters assigned to partitions
without a valid file system (read "valid for Windows"), causing our
unmounting routine to fail in these cases.

Change-Type: patch
Changelog-Entry: Fix "Error: Command Failed" error when unmounting on Windows.
Fixes: https://github.com/resin-io/etcher/issues/1019
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-16 13:50:53 -04:00
Juan Cruz Viotti
a60f7134fc chore: add an HTML linter and fix its warnings (#1077)
This PR creates a script at `scripts/html-lint.js` that runs a NodeJS
HTML linter package that understands AngularJS on top of all our HTML
templates.

The following error was detected and fixed:

```
1 errors at lib/gui/pages/finish/templates/success.tpl.html
  [4:63] Duplicate attribute “class”.
```

This script will run as part of `npm run lint`, but you can call it
independently as `npm run htmllint`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-13 14:58:29 -04:00
Ștefan Daniel Mihăilă
92fdba3642 upgrade: angular to v1.6.1; angular-ui-bootstrap to v2.5.0 (#1083)
Angular 1.5 has a bug that causes angular's `$exceptionHandler`
to be called for rejected `$q` promises even if they have
a rejection handler. This bug caused duplicate error messages
in Etcher.

A consequence of upgrading to Angular 1.6 is that `$q` promises
without a rejection handler will throw `Possibly unhandled rejection`
errors. To avoid these errors, this commit moves code responsible
for opening a tooltip from the template to the controller and handles
the rejection.

Other packages upgraded:
- angular-moment to v1.0.1
- angular-ui-router to v0.4.2
- angular-mocks to v1.6.1

Change-type: patch
Changelog-Entry: Fix duplicate error messages
Fixes: https://github.com/resin-io/etcher/issues/1082
See: https://github.com/angular/angular.js/issues/7992
See: https://github.com/angular/angular.js/pull/13662
2017-02-07 19:12:32 -04:00
Juan Cruz Viotti
53ea89782c chore: get rid of commitizen
No one on the team is using this and the adaptor we're using proved to
be suboptimal. We might consider this again once we develop a good
Commitizen adapter integrated more closely with Versionist.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-07 13:33:52 -04:00
Juan Cruz Viotti
c7d4ac6518 upgrade: drivelist to v5.0.9
This version doesn't throw an error if there is `stderr` output from the
scripts but the scripts exit with code zero.

Instead, the module prints the `stderr` output to a `debug` channel, so
we enable debug information by setting a `localStorage` value in order
to see what's going on.

Fixes: https://github.com/resin-io/etcher/issues/1034
Change-Type: patch
Changelog-Entry: Ignore `stderr` output from drive detection scripts if they exit with code zero.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-06 14:53:38 -04:00
Juan Cruz Viotti
8e5840ce69 chore: integrate codespell and fix existing spelling issues
This tool scans the comments of every source file and reports back
spelling errors.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-06 14:53:20 -04:00
Juan Cruz Viotti
95d4f2f608 fix(GUI): prevent flashing the drive where the source image is located
Currently Etcher will allow you to flash an image to the same drive that
contains the image. As a way to protect against that case we introduce
the concept of a "source drive", which means a drive that contains the
source image.

This commit adds the following logic around this new concept:

- Don't auto-select a source drive
- De-select an already selected drive if an image inside it is selected
- Disable the drive in the drive selector modal
- Add a "Source Drive" badge to the drive in the drive selector modal

Fixes: https://github.com/resin-io/etcher/issues/830
Change-Type: minor
Changelog-Entry: Prevent flashing the drive where the source image is located.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-06 14:53:08 -04:00
Juan Cruz Viotti
16340b412a doc: workaround to npm shrinkwrap development dependencies bug
There are some npm versions that for some strange reason will attempt to
put *every* single development dependency in the `npm-shinkwrap.json`
file when editing the dependencies list.

This commit describes a workaround I've found to ensure only production
dependencies are added to the file.

I also renamed our `npm run shrinkwrap` script to `npm run
clean-shrinkwrap` since in some recent versions of npm, running `npm
shrinkwrap` will trigger our custom script instead of the original
implementation.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-06 14:52:40 -04:00
Juan Cruz Viotti
0187cb0b2d upgrade: drivelist to v5.0.8 (#1060)
Change-Type: patch
Changelog-Entry: Fix 'MySQL' is not recognised as an internal or external command error on Windows.
See: https://github.com/resin-io-modules/drivelist/issues/133
Fixes: https://github.com/resin-io/etcher/issues/1025
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-30 10:03:04 -04:00
Juan Cruz Viotti
fd9d3ce749
Revert "refactor: remove extended archives extra functionality (#1055)"
This reverts commit b78473ea0ebd76233217fb4f236bb34be635da90.
2017-01-26 18:36:33 -04:00
Juan Cruz Viotti
b78473ea0e refactor: remove extended archives extra functionality (#1055)
We currently attempt to read extra metadata from ZIP files, such as a
logo, image name, image url, etc. In order to simplify the metadata
story, we decided that this metadata will not live on the image itself,
but rather on a centralised repo, which greatly simplified our custom
archive extraction logic and allows us to make use of these nice
features even when streaming the image directly from the internet.

We'll be working on bringing back this functionality from a centralised
repo in subsequent commits.

Change-Type: major
Changelog-Entry: Remove extended archives metadata extraction logic.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-26 15:21:01 -04:00
Juan Cruz Viotti
1bfcee06e2 refactor(image-stream): stream original/final sizes (#1050)
The `image-stream` module currently returns a readable stream, a
transform stream, a "size", and an optional "estimatedUncompressedSize".

Based on this information, its hard to say what "size" represents. Some
format handlers return the compressed size and provide a decompression
transform stream while others return the decompressed stream directly
and put the decompressed size in "size".

As a way to simplify this, every format handler now returns a "size"
object with the following properties:

- `original`: The original compressed size
- `final.estimated`: Whether the final size is an estimation or not
- `final.value`: The final uncompressed size

As a bonus, we extract the file size retrieval logic to
`imageStream.getFromFilePath()`, which is the onlt part where the
concept of a file should be referred to.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-26 12:01:53 -04:00
Juan Cruz Viotti
0e1f50422e refactor: integrate etcher-image-stream into the etcher repository (#1040)
This is a long lasting task. The `etcher-image-stream` project takes
care of converting any kind of image input into a NodeJS readable
stream, handling things like decompression in betwee, however its a
module that, except for weird cases, there is no benefit on having
separate from the main repository.

In order to validate the assumption above, we've left the module
separate for almost a year, and no use case has emerged to keep it
like that.

This commit joins the code and tests of that module in the main
repository.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-25 10:32:37 -04:00
Juan Cruz Viotti
acc1f05269 refactor: move lib/shared/child-writer to lib/child-writer (#1041)
The `child-writer` module is not re-used by both the GUI and the CLI, so
it makes sense to have it in `lib/child-writer`.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-24 12:06:34 -04:00
Juan Cruz Viotti
5b3926cf10 v1.0.0-beta.18 2017-01-16 11:02:11 -04:00
Juan Cruz Viotti
2b4b1da492 upgrade: drivelist to v5.0.6 (#1020)
- https://github.com/resin-io-modules/drivelist/issues/130

Change-Type: patch
Changelog-Entry: Fix "This key is already associated with an element of this collection" error when multiple partitions point to the same drive letter on Windows.
Fixes: https://github.com/resin-io/etcher/issues/1004
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-12 15:21:58 -04:00
Juan Cruz Viotti
c707c76633 feat(CLI): improve error messages (#1015)
- Inline dictionary of common error codes and friendly descriptions

We used to rely on `resin-cli-errors` for this, however the friendly
descriptions set there can be usually very Resin CLI specific, and thus
confusing to Etcher users.

The dictionary, along with other error related utilities live in
`lib/cli/errors.js`.

- Print error descriptions and codes if they are found

- Move `utils.printError()` to `errors.print()`

Change-Type: minor
Changelog-Entry: Improve Etcher CLI error messages.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-11 18:45:59 -04:00
Juan Cruz Viotti
971ef7d8f9 chore: make use of the "spec" mocha reporter (#1013)
The "min" mocha reporter clears the screen after each run, causing any
error/warning from the renderer process tests to be visually overwritten
by the main process tests.

Therefore, we now make use of the "spec" mocha reporter.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-10 21:36:17 -04:00
Juan Cruz Viotti
404eeffbeb chore: compile CSS into lib/gui/css (#1002)
We currently compile CSS into `build/css`, however we plan to use
node-gyp in this project, which can't be configured to build to a
directory other than `build`, therefore, the compiled CSS must move
somewhere else.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-06 15:55:07 -04:00
Ștefan Daniel Mihăilă
050d187e6f refactor: extract SelectionStateModel stateless functions (#982)
`SelectionStateModel`'s methods `isSystemDrive` and `isDriveLocked`
don't depend on application state. They have been extracted in a different
AngularJS service: `DriveConstraintsModel`. The new service's actual
implementation is in `lib/src`, in order to be reused by the CLI.

Miscellaneous changes:

- Rename `lib/src` to `lib/shared`
- Refactor `drive-constraints` to throw when image is undefined

The default behaviour was to pretend that we're all good if the if
the image is not specified. We're not using this "feature", and
it can be dangerous if we forget to pass in the image.

- Make `isSystemDrive` return `false` if `system` property is undefined
- Use `drive-constraints` in `store.js`

Change-Type: patch
2017-01-06 12:42:11 -04:00
Juan Cruz Viotti
dc32699b65 upgrade: drivelist to v5.0.5 (#1001)
- https://github.com/resin-io-modules/drivelist/pull/129

Change-Type: patch
Changelog-Entry: Fix system drives detected as removable drives on Mac Mini.
See: https://github.com/resin-io/etcher/issues/983
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-06 12:22:08 -04:00
Juan Cruz Viotti
e641265f4d upgrade: etcher-image-write to v9.0.0 (#1000)
This version includes support for retrying up to ten times when EIO
errors are encountered during reading.

See: https://github.com/resin-io-modules/etcher-image-write/pull/70
Fixes: https://github.com/resin-io/etcher/issues/981
Change-Type: patch
Changelog-Entry: Fix sporadic "EIO: i/o error, read" errors during validation.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-06 11:31:16 -04:00
Juan Cruz Viotti
e210a2ba0e upgrade: etcher-image-write to v8.1.5 (#998)
- https://github.com/resin-io-modules/etcher-image-write/pull/73

Fixes: https://github.com/resin-io/etcher/issues/834
Changelog-Entry: Fix "EIO: i/o error, write" error.
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-01-05 11:20:19 -04:00
Juan Cruz Viotti
8e7599b366 chore: implement electron-configure-package-win32.sh (#962)
This script configures an Electron package on Windows.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-12-13 11:04:09 -04:00
Juan Cruz Viotti
55bd372082 v1.0.0-beta.17
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-28 09:58:29 -04:00
Juan Cruz Viotti
6e0d8e1f5c refactor: ditch electron-osx-sign for OS X signing (#901)
Making use of `codesign` directly allows us to have much more
flexibility in how we sign things, which will prove very valuable when
adapting this `sign.sh` script to code sign the Etcher CLI.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-28 01:13:02 -04:00
Juan Cruz Viotti
3eac1762b1 upgrade: drivelist to v5.0.4 (#893)
- https://github.com/resin-io-modules/drivelist/pull/125

Change-Type: patch
Changelog-Entry: Fix drive scanning exceptions on GNU/Linux systems with `net.ifnames` enabled.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 12:56:44 -04:00
Juan Cruz Viotti
c4868995aa chore: add appdmg and ds-store to shrinkwrapIgnore (#895)
These dependencies are suddently causing issues when running `npm
install` in platforms other than OS X.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-25 12:08:29 -04:00
Juan Cruz Viotti
4296868ff7 upgrade: drivelist to v5.0.3 (#871)
See: https://github.com/resin-io-modules/drivelist/pull/120
Fixes: https://github.com/resin-io/etcher/issues/870
Change-Type: patch
Changelog-Entry: Fix `0x80131700` error when scanning drives on Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-16 14:29:34 +00:00
Juan Cruz Viotti
6456a8fe96 upgrade: drivelist to v5.0.1 (#869)
- Fix internal SDCard reader descriptions in GNU/Linux.
- Transform `mountpoint` into an array of mountpoints.

Change-Type: patch
Changelog-Entry: Fix internal SDCard drive descriptions.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-16 13:52:20 +00:00
Juan Cruz Viotti
4e3bdb7e22 refactor(CLI): move UNIX umount functionality to repository (#866)
- Move UNIX unmount functionality to the CLI module
- Run `electron-mocha` for the CLI code
- Make unmount command templates that take a `drivelist` object as input

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-14 11:11:49 +02:00
Juan Cruz Viotti
6e03a00008 upgrade: electron-mocha to v3.1.1 (#854)
The current version would exit with error code 0 even when the tests
failed, causing CI servers to report false positives.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-09 22:20:11 +02:00
Juan Cruz Viotti
0085880d3c chore: add productDescription to package.json (#842)
This key is added as the long description of the Debian package.
Omitting this option means that `description` is duplicated two times,
which is of course not the desired outcome.

See: https://github.com/resin-io/etcher/issues/632
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-09 17:04:05 +02:00
Juan Cruz Viotti
9c4afa0680 upgrade: umount to v1.1.5 (#843)
The changes we're interested in are:

- Escape device paths containing spaces.

Change-Type: patch
Changelog-Entry: Fix unmount issues in GNU/Linux and OS Xwhen paths contain spaces.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-07 18:07:57 +02:00
Juan Cruz Viotti
136d935eed upgrade: etcher-image-write to v8.1.4 (#831)
We're interested in the following change, which causes the last
unaligned block on an image to be aligned to 512K instead of to 1M if
its smaller than 512K, and to 1M otherwise.

- https://github.com/resin-io-modules/etcher-image-write/pull/58

Fixes: https://github.com/resin-io/etcher/issues/685
Change-Type: patch
Changelog-Entry: Fix "Not Enough Space" error when flashing unaligned images.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-07 17:02:23 +02:00
Juan Cruz Viotti
af0cfd9587 chore: update package.json and README.md to match repo description (#824)
Repository description says "Flash OS images to SD cards & USB drives,
safely and easily.", while `package.json` currently says "An image
flasher with support for Windows, OS X and GNU/Linux.", and `README.md`
contains "Flash OS images to SD cards & USB drives, safe & easy."

See: https://github.com/resin-io/etcher/issues/797
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-03 09:41:41 -04:00
Juan Cruz Viotti
adfa0fcd83 chore: remove removedrive from dependencies (#825)
This dependency is already being listed in `optionalDependencies`, which
the place it really belongs to.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-03 09:41:32 -04:00
Juan Cruz Viotti
428dbeaf55 upgrade: umount to v1.1.4 (#817)
- This new version passes `force` to `diskutil unmountDisk`

Change-Type: patch
Changelog-Entry: Fix `at least one volume could not be unmounted` error in OS X.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-11-02 00:04:36 -04:00
Juan Cruz Viotti
bc985f08a9 fix(GUI): duplicate drives in Windows (#790)
If a drive contains multiple partitions that Windows recognises and
mounts, then `drivelist` will incorrectly display separate drive objects
for each partition, causing `ngRepeat` to complain in the drive selector
component.

The issue was fixed by grouping the mountpoints of all recognised
partitions in a single drive object, as we do with the other supported
operating systems.

After the fix, `drivelist` also removed its `name` property (since its
now always equal to `device`), so some extra logic to compute an
appropriate display name for the drive has been introduced to
`DriveScannerService`.

Fixes: https://github.com/resin-io/etcher/issues/720
See: https://github.com/resin-io-modules/drivelist/pull/100
Change-Type: patch
Changelog-Entry: Fix duplicate drives in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-10-31 01:18:58 -04:00
Juan Cruz Viotti
8103ba851f v1.0.0-beta.16
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-10-28 16:42:15 -04:00
Juan Cruz Viotti
d9822faf2f fix(GUI): emit progress back to parent using node-ipc (#774)
This PR makes use of `node-ipc` to emit progress information from the
child CLI to the GUI process rather than the tailing approach we've
been doing until now.

This change was motivated by the following Electron fix which landed in
v1.4.4: https://github.com/electron/electron/pull/7578. Before such fix,
Electron would not output anything to stdout/stderr if the Electron
process was running with `ELECTRON_RUN_AS_NODE` under Windows, which
forced us to implement `--log` option in the Etcher CLI to output state
information to a file.

Since this issue is fixed, we can consume the Etcher CLI output from
within `child_process.spawn`, which opens more interesting possibilities
for sharing information between both processes.

This coindentally fixes a Windows issue where the tailing module would
receive malformed JSON, causing Etcher to crash at `JSON.parse`. The
reason of this problem was a bug in the tailing module we were using.

Fixes: https://github.com/resin-io/etcher/issues/642
Change-Type: patch
Changelog-Entry: Fix "Unexpected end of JSON" error in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-10-25 23:56:39 -04:00
Juan Cruz Viotti
c7f4313ded upgrade: etcher-image-stream to v5.1.0 (#752)
We're particularly interested in the following change:

- Add `etch` support.

Also:

- Add a `.description` property to all archive related errors.
- Rename archive metadata base path from `_info` to `.meta`.

Change-Type: minor
Changelog-Entry: Add support for `etch` images.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2016-10-07 15:32:25 -03:00