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>
This was a small issue affected due to the change in order of the
supported extensions in the ImageSelectionController.
Since we want to test that the array contents are equally the same
independently on the order, we sort both sides of the assertion.
This issue was not caught before since `electron-mocha` was reporting
exit code 0 even when there were changes failing, causing the CI
services to incorrectly support success.
See: https://github.com/resin-io/etcher/pull/854
See: https://github.com/resin-io/etcher/pull/806
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Publishing to Homebrew Cask involves changing a Cask file in the
official Cask registry pull request updating the `version` and `sha256`
properties.
See: https://github.com/caskroom/homebrew-cask/pull/26319
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
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>
Every modal in the application should contain the same "close" X at the
top right corner, for consistency purposes. The only modal lacking this
button was the update notifier modal.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
- Change dialog message to "Are you sure you want to turn this on? You
will be able to overwrite your system drives if you're not careful."
- Remove "CANCEL" button and put a cross at the top right corner.
- Change dialog button label from "YES, CONTINUE" to "ENABLE UNSAFE
MODE"
In order to adapt to changes described above:
- `WarningModalService.display()` now takes an object including
`description`, and `confirmationLabel`
Fixes: https://github.com/resin-io/etcher/issues/729
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
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>
The `settings-dangerous-modal` modal size class doesn't exist anymore,
and was renamed to `warning-modal`. This was causing the exclamation
sign from the header to not be displayed in red, as it should.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit notes down the most important technologies used by Etcher,
so that contributors know what they should focus their learning in.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
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>
This dependency is already being listed in `optionalDependencies`, which
the place it really belongs to.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
There are some settings, such as "unsafe mode", that prompt the user for
confirmation before actually confirming the setting. In these cases,
when the user attempts to check the checkbox, the checkbox remains
checked unless the user rejects the confirmation dialog, in which case
the checkbox value is reverted.
In order to provide a better UX, we now keep the checkbox unchecked
until the user confirms.
See: https://github.com/resin-io/etcher/issues/729
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The new ordering of the main supported extensions will be: `img`, `iso`,
`zip`.
We make use of `_.intersection` in order to ensure that the values we're
hardcoding indeed exist in the list of all supported format extensions,
otherwise they won't appear at all. This ensures we never show
extensions that are not supported.
Partly fixes: https://github.com/resin-io/etcher/issues/787
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
- 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>
Currently, we are not making sure the IPC server we start at
`lib/src/child-writer/index.js` gets closed when the child process exits
(successfully or not). This eventually causes issues when the user click
"flash again", since the stateful `ipc` global exposed by `node-ipc`
gets initialised again, causing the module to get to an invalid state
that eventually results in `this.log is not a function`.
- We've added `ipc.server.stop()` to both the `error` and `close` event
handlers (which are self exclusive, according to the docs).
- We've added `child.kill()` to the child `stderr` handler, since that
function causes the `close` event to be triggered, which in turns
calls `ipc.server.stop()`.
Change-Type: patch
Changelog-Entry: Fix `this.log is not a function` error when clicking "flash again".
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
`yargs` wraps help output lines, causing the examples to be displayed
like this:
```
Examples:
/usr/bin/nodejs bin/etcher
raspberry-pi.img
/usr/bin/nodejs bin/etcher --no-check
raspberry-pi.img
/usr/bin/nodejs bin/etcher -d /dev/disk2
ubuntu.iso
/usr/bin/nodejs bin/etcher -d /dev/disk2
-y rpi.img
```
As a solution, we can set `.wrap(null)` to completely disable wrapping.
Fixes: https://github.com/resin-io/etcher/issues/810
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `docs/CLI.md` points to user to `docs/CONTRIBUTING.md` for
instructions in how to install dependencies. This document previously
included the explicit `npm` commands to run, but was then changed to
point to the platform scripts, which means that if the user follows the
current instructions but has a NodeJS version which is not ABI
compatible with the NodeJS version used by the currently used Electron
version, the user will get an incompatibility error.
Fixes: https://github.com/resin-io/etcher/issues/801
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Setting a Chocolatey cache and Making sure it gets persisted means that
future builds don't have to download every Chocolatey package from the
internet every time.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We are not using Hound CI to display lint warnings anymore. The CI
servers are in charge of running the linters now.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The usual case is images requiring special treatment. We recommend the
users to use specialised tooling for those cases.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
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>
We're now including the version as part of the filename, which means
`Etcher-linux-x64` is no longer 100% accurate. As a solution, we include
a filename with "placeholders" for the version and architecture, to
avoid harcoding a specific version.
See: 18e9d1eb11 (commitcomment-19619181)
See: https://github.com/resin-io/etcher/pull/764
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We do this for macOS and GNU/Linux for debugging purposes, but we
weren't doing it for Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The AppImage `desktopintegration` prompt can also be disabled by setting
the `SKIP` environment variable.
As a matter of fact, we use this trick inside Etcher itself when
executing the Etcher CLI as a child process of the Etcher GUI.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This PR makes sure every command line argument that represents an
absolute path is surrounded by double quotes, to avoid any potential
escaping issue.
This simplifies a lot the various special character escaping routines we
had in place, since we now only have to make sure double quotes inside
the paths are escaped.
Fixes: https://github.com/resin-io/etcher/issues/773
Change-Type: patch
Changelog-Entry: Prevent escaping issues during elevation by surrounding paths in double quotes.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
When running the install script as root (e.g. inside a Docker container), bower complained that it
"shouldn't" be run with sudo. When running the x86 install multiple times, it tried to move
Etcher-linux-ia32 inside the existing Etcher-linux-x86/ folder, rather than renaming it, which meant
later commands failed.
If we pass relative paths as arguments to the AppImage, they get
resolved from `/tmp/.mount_XXXXXX/usr`. We can exploit this to run the
Etcher CLI directly from the AppImage, rather than having to mount it
ourselves:
```sh
ELECTRON_RUN_AS_NODE=1 Etcher-linux-x64.AppImage bin/resources/app.asar [OPTIONS]
```
By using this little trick, we get rid of both our custom mounting logic
and the need of surrounding the command to run in single quotes,
therefore avoiding a whole new kind of escaping issues.
Since running the CLI directly from the AppImage means that the
`desktopintegration` will be ran for the CLI, we pass the `SKIP`
environment variable to avoid having it prompt the user for
installation.
We also updated the `desktopintegration` script to the latest version,
which reduces the amount of logging plus other minor fixes.
Fixes: https://github.com/resin-io/etcher/issues/637
Change-Type: patch
Changelog-Entry: Fix Etcher leaving zombie processes behind in GNU/Linux.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
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>
This PR zips the package that is built by running:
```sh
.\scripts\build\windows.bat package <arch>
```
And puts it in `etcher-release/installers`.
Fixes: https://github.com/resin-io/etcher/issues/760
Change-Type: minor
Changelog-Entry: Publish standalone Windows builds.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
AppImages need to be marked as executables before they can be used.
Distributing them directly means that virtually all web browsers will
automatically remove the execution permissions, leading us to have to
explain users how to add it back with `chmod`, etc.
For simplicity purposes, we'll be distributing AppImages inside ZIPs,
which ensure the execution permissions are added back when the user
decompresses it.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>