We translate function arguments (e.g: `$1`, `$2`, etc) to readable names
using shell variables in the top of every shell function in the build
scripts.
Since we were not declaring these variables as `local`, two functions
using the same "argument name" would override each other.
For example:
```sh
function foo() {
variable=$1
# Do something with $variable
}
function bar() {
variable=$1
# Do something with $variable
}
foo "Hello World"
echo $variable
> Hello World
bar "Changed variable"
echo $variable
> Changed variable
```
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The main purpose of this change is to simplify the interface and avoid
unnecessary text.
Fixes: https://github.com/resin-io/etcher/issues/742
Change-Type: minor
Changelog-Entry: Use info icon instead of "SHOW FULL FILE NAME" in first step.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `$output_package` variable is defined inside the `package_x$ARCH`
functions, which means that if we run the following commands:
```sh
./scripts/build/linux.sh package x64
./scripts/build/linux.sh appimage x64
```
The `$output_package` variable will not be defined when the script runs
the `appimage` command.
To workaround this issue, we declare a new `$package_directory` variable
inside the `appimage` command clause.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The "dropzone" directive, which we use to implement drag and drop
support, was not being loaded in the application at all for some reason.
It was probably accidentally deleted during major refactorings.
Change-Type: patch
Changelog-Entry: Fix drag and drop not working anymore.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Document the need to have a polkit authentication running in GNU/Linux
to be able to go through the authentication system.
Fixes: https://github.com/resin-io/etcher/issues/756
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
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>
Currently, if the "CHANGE" label at the bottom of the image selection
step, once an image has been selected, is clicked, the selection state
is cleared.
Since https://github.com/resin-io/etcher/pull/602, we allow the drive
state to change independently of the image selection state, so the above
behaviour doesn't make sense anymore.
Fixes: https://github.com/resin-io/etcher/issues/730
Change-Type: patch
Changelog-Entry: Don't clear selection state when re-selecting an image.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
In Windows, if the user unmounts a drive, then the drive becomes
inaccessible to the OS. Compare this to UNIX based operating systems,
where an unmounted drive is still available for many I/O operations.
To prevent confusion, we say "eject" instead of "unmount" when running
on Windows, despite "unmount" being the correct way of saying it.
See: https://github.com/resin-io/etcher/issues/750
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We list all the pre-requisites needed to get up and running with Etcher,
and then say "run this script to install dependencies", which can be
interpreted as if the install script actually also installs the
pre-requisites, which is not the case.
To clarify this, we add a clear bold notice, and change "dependencies"
to "npm dependencies", to make the distinction clearer.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Debian packaging tools cannot analyze the binaries if they are compressed
with upx. If we move the compression to the appimage command, then the
output of the package command can be used for building debian packages.
With this addition, the `package` command simply creates a standalone package, while "appimage" is the one that creates the actual AppImage. The "all" command still generates the AppImage as before.
Some of the packaging modules that we use don't work on previous NodeJS
versions.
Fixes: https://github.com/resin-io/etcher/issues/725
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
When the application is packaged as an AppImage, we're accidentally not
applying the whitespace escaping routine, causing images that contain
white spaces to cause Etcher to stall and never start the write.
The issue was even harder to debug given that the problem was not
reproducible when running Etcher from `npm start`.
Change-Type: patch
Changelog-Entry: Fix flashing never starting after elevation in GNU/Linux.
Fixes: https://github.com/resin-io/etcher/issues/631
Fixes: https://github.com/resin-io/etcher/issues/665
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This results in ~10MB savings, which is not much, but still worth
reducing as much as we can.
See: https://github.com/resin-io/etcher/issues/711
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Sometimes a flash error ends up taking the user's drive in a state that
can't be easily recover with usual disk utility tools. For when this
happens, we add some documentation about fail-proof methods to recover
the drive.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This feature is very appealing when running Etcher ouside a common
desktop environment, for example, as a Resin.io application. In such a
platform, an update notifier that points the user to the website makes
no sense, since the platform itself is responsible for the update.
For such cases, we added support for an environment variable called
`ETCHER_DISABLE_UPDATES`, that when set, will prevent the update check
altogether.
Change-Type: minor
Changelog-Entry: Allow the user to disable auto-update notifications with an environment variable.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Recently, we've added support for a `recommendedDriveSize` property in
the `manifest.json` of extended image archives, which the image can use
to warn the user that his drive, even if it is large enough to hold the
image, might not be large enough to deliver a good usage experience
later on.
When this property is found, the GUI reacts in the following ways:
- Drives that are large enough to hold the image but don't meet the
recommended drive size are tagged with a warning label in the drive
selector component.
- Attempting to select a "labeled" drive opens a warning modal asking
for user confirmation.
- Drives that don't meet the recommended drive size declared in the
image won't get auto-selected.
- If there is a drive already selected, and the user picks an image
whose recommended drive size is greater than the drive size, the
currently selected drive gets auto-deselected.
Code-wise, the following significant changes have been introduced:
- Implement `SelectionStateModel.getImageRecommendedDriveSize()`.
- Implement `SelectionStateModel.isDriveSizeRecommended()`.
- Extract `WarningModal` out of the settings page (the dangerous setting
modal).
Change-Type: minor
Changelog-Entry: Allow images to declare a recommended minimum drive size.
See: https://github.com/resin-io-modules/etcher-image-stream/pull/36
Fixes: https://github.com/resin-io/etcher/issues/698
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This new version contains the following changes:
- Add `recommendedDriveSize` property in `_info/manifest.json`.
- Upgrade `unbzip2-stream` to v1.0.10, which fixes a known uncaught
exception when decompressing large `.bz2` files.
- Add support for markdown instructions at
`_info/instructions.markdown`.
Changelog-Entry: Upgrade `etcher-image-stream` to v4.3.0.
Change-Type: minor
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This function used to handle `ENOSPC` as a corner case in order to
prevent it from being shown using the default Analytics/Dialog
machinery. This was because the "alert ribbon" used to react to changes
automatically from the templates, however, now that the "alert ribbon"
was removed, and replaced it with modals, we have finer control of how
and when this error gets shown, so the workaround is no longer
necessary.
See: 951b8de9fc
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
If the user encounters a flash error, and then presses the "Retry"
button, the drive selection is cleared, but then is re-selected right
away because its probably the only available drive, leading to a very
strange behaviour UX-wise.
As a solution, we avoid clearing the drive selection.
Change-Type: patch
Changelog-Entry: Don't clear the drive selection if clicking the "Retry" button.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The Etcher CLI displays a nice `Checksum: $checksum` message upon
completion. Since the addition of bmap support, a checksum for an image
might not be calculated, causing the CLI to display `Checksum:
undefined`.
This PR takes care of this small UX issue by only showing the checksum
message if one indeed exists.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This PR makes use of the `bytesToZeroOutFromTheBeginning` option
introduced in:
- https://github.com/resin-io-modules/etcher-image-stream/pull/34
- https://github.com/resin-io-modules/bmapflash/pull/6
The option, when set in `manifest.json`, causes a certain amount of
bytes to be zeroed out before the bmap-assisted write process starts, in
order to prevent issues on certain ROM bootloaders causing by
`bmap-tools` thinking certain parts of the initial sectors are holes.
The following components were upgraded:
- `etcher-image-stream` was upgraded to v4.1.0
- `etcher-image-write` was upgraded to v8.1.0
Changelog-Entry: Allow archive images to configure a certain amount of bytes to be zeroed out from the beginning of the drive when using bmaps.
Change-Type: minor
Fixes: https://github.com/resin-io/etcher/issues/673
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
As a way to simplify the design and make more use of available
components rather than creating specialised ones, we replaced the
`.alert-ribbon` component, which consisted of an orange alert appearing
at the top of the screen for when a validation failed, the drive ran out
of space, or other issues, with a modal.
This change allowed us to remove the "warning"-related colors from the
theme palette.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This new version stops sending a `passedValidation` boolean property
upon completion and still throws an `EVALIDATION` error when validation
fails.
Such small chance allows us to get rid of lot of complexity related to
handling the `passedValidation` value in the application state.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
A function in the `MainController` was being named
`shouldFlashStateBeDisabled`, however it should have been
`shouldFlashStepBeDisabled`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
For consistency purposes on the main screen, we switch the "Connect a
drive" button to be the classic primary blue button as the other ones.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We've recently added support for a `supportUrl` property in an archive
image `_info/manifest.json`, which the publisher can use to define the
URL where it would like to redirect users facing problems.
This PR makes the "Need help?" link at the top right corner open the
configured `supportUrl` url, and fallback to the original Etcher's help
page if no `supportUrl` is found.
In order to accomplish this, we made the following changes:
- Implement `SelectionStateModel.getImageSupportUrl()`
- Implement `HeaderController` controller
Change-Type: minor
Changelog-Entry: Make the "Need help?" link dynamically open the image support url.
Fixes: https://github.com/resin-io/etcher/issues/662
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We're interested in the following changes:
- Add `supportUrl` property in `_info/manifest.json`.
- Add `releaseNotesUrl` property in `_info/manifest.json`.
- Add `version` property in `_info/manifest.json`.
- Add `checksum` and `checksumType` properties in `_info/manifest.json`.
Link: https://github.com/resin-io-modules/etcher-image-stream/blob/master/CHANGELOG.md
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This component is visually shown on the top of the window, however its
HTML code is placed below the "Flash" button, which is
counter-intuitive.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Despite all modals sharing the same design and layout, each of theme is
being styled separately, when most of the CSS rules can be moved and
generified to `_modal.scss` and re-used by all of them.
This PR also moves `lib/gui/scss/components/_modal.scss` to the "Modal"
Angular's module.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `.button` component is not the responsible of knowing the
`min-width` it should occupy in the actual pages.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We have some global CSS rules that affect `.alert` living in
`_bootstrap.scss`, however `.alert` is only being used by our
`.alert-ribbon` component, so it makes sense to move those rules over
there.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Move `.badge` coloring to the main page's style file, since the style we
currently hardcode on the component itself is very tied to the
particular context the badge is being instantiated in.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
`.label-danger` is defined by Bootstrap, and its coloring re-uses what
was defined in `$brand-danger`, which is currently unset.
To prevent the module from going out of sync with our new CSS palette,
we explicitly declare the colorings in the component file.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This is a big PR that extracts out a sensible set of SCSS color
variables that can be used to customise Etcher's look.
To achieve such goal, the following changes were introduced:
- Create a separate `lib/gui/scss/modules/_theme.scss` to conveniently
hold all SCSS color variables.
- Decouple button styles from Bootstrap's `.btn`.
- Stop configuring Bootstrap colors as a whole using the SCSS variables
it exposes and instead declare them directly in the modules that make
use of them.
- Normalize all modal layouts into one. We had like 3 different modal
layouts, each with their own title/body colors, etc. To simplify the
color palette, we make use of a single modal layout everywhere.
- Remove `.progress-button--primary`. `.progress-button` is now
"primary" by default.
- Be precise about `tick` foreground colors.
- Rename `.label-default` to `.label-inset`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
`scss_lint` suddenly requires Ruby 2, which is breaking all our Travis
CI and Appveyor builds, which ship older versions.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Packaging Etcher with NSIS v3.x results in weird errors. We only support
v2.x, for which the latest version is v2.51.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This file will contain all information necessary to be able to get a
development version of Etcher running locally.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>