Merge pull request #1556 from balena-io/1182-push-hangs-windows

Fix 'balena push' hanging on Windows
This commit is contained in:
Paulo Castro 2020-01-14 14:30:43 -05:00 committed by GitHub
commit a6153869e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 35 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ lib-cov
# Coverage directory used by tools like istanbul # Coverage directory used by tools like istanbul
coverage coverage
.nyc_output
# node-waf configuration # node-waf configuration
.lock-wscript .lock-wscript

View File

@ -579,16 +579,15 @@ confirm non interactively
List the supported device types (like 'raspberrypi3' or 'intel-nuc'). List the supported device types (like 'raspberrypi3' or 'intel-nuc').
The --verbose option adds extra columns/fields to the output, including the The --verbose option adds extra columns/fields to the output, including the
"STATE" column whose values are one of 'beta', 'release' or 'discontinued'. "STATE" column whose values are one of 'beta', 'released' or 'discontinued'.
However, 'discontinued' device types are only listed if the '--discontinued' However, 'discontinued' device types are only listed if the '--discontinued'
option is used. option is used.
The --json option is recommended when scripting the output of this command The --json option is recommended when scripting the output of this command,
(perhaps in combination with the [jq because the JSON format is less likely to change and it better represents data
utility](https://stedolan.github.io/jq/manual/)), as it is more parser types like lists and empty strings (for example, the ALIASES column contains a
friendly (e.g. the ALIASES column contains a list of zero or more values) list of zero or more values). The 'jq' utility may be helpful in shell scripts
and also more "stable" in relation to added or reordered columns in tabular (https://stedolan.github.io/jq/manual/).
output (which is intended for "human eyes").
Examples: Examples:
@ -636,14 +635,16 @@ SERVICE columns to distinguish between application-wide, device-specific and
service-specific variables. As asterisk in these columns indicates that the service-specific variables. As asterisk in these columns indicates that the
variable applies to "all devices" or "all services". variable applies to "all devices" or "all services".
If you are parsing the output in a script, please select the JSON format with The --json option is recommended when scripting the output of this command,
the '-j' option. This avoids future compatibility issues if columns are added, because the JSON format is less likely to change and it better represents data
renamed or reordered. Also, when the JSON format is selected, an empty JSON types like lists and empty strings. The 'jq' utility may be helpful in shell
array ([]) is printed instead of an error message when no variables exist for scripts (https://stedolan.github.io/jq/manual/). When --json is used, an empty
the given query. When querying variables for a device, note that the application JSON array ([]) is printed instead of an error message when no variables exist
name may be null in JSON output (or 'N/A' in tabular output) if the application for the given query. When querying variables for a device, note that the
linked to the device is no longer accessible by the current user (for example, application name may be null in JSON output (or 'N/A' in tabular output) if the
in case the current user has been removed from the application by its owner). application linked to the device is no longer accessible by the current user
(for example, in case the current user has been removed from the application
by its owner).
Examples: Examples:
@ -986,8 +987,11 @@ show additional commands
## version ## version
Display version information for the balena CLI and/or Node.js. Display version information for the balena CLI and/or Node.js.
If you intend to parse the output, please use the -j option for
JSON output, as its format is more stable. The --json option is recommended when scripting the output of this command,
because the JSON format is less likely to change and it better represents
data types like lists and empty strings. The 'jq' utility may be helpful
in shell scripts (https://stedolan.github.io/jq/manual/).
Examples: Examples:

View File

@ -40,16 +40,15 @@ export default class DevicesSupportedCmd extends Command {
List the supported device types (like 'raspberrypi3' or 'intel-nuc'). List the supported device types (like 'raspberrypi3' or 'intel-nuc').
The --verbose option adds extra columns/fields to the output, including the The --verbose option adds extra columns/fields to the output, including the
"STATE" column whose values are one of 'beta', 'release' or 'discontinued'. "STATE" column whose values are one of 'beta', 'released' or 'discontinued'.
However, 'discontinued' device types are only listed if the '--discontinued' However, 'discontinued' device types are only listed if the '--discontinued'
option is used. option is used.
The --json option is recommended when scripting the output of this command The --json option is recommended when scripting the output of this command,
(perhaps in combination with the [jq because the JSON format is less likely to change and it better represents data
utility](https://stedolan.github.io/jq/manual/)), as it is more parser types like lists and empty strings (for example, the ALIASES column contains a
friendly (e.g. the ALIASES column contains a list of zero or more values) list of zero or more values). The 'jq' utility may be helpful in shell scripts
and also more "stable" in relation to added or reordered columns in tabular (https://stedolan.github.io/jq/manual/).
output (which is intended for "human eyes").
`; `;
public static examples = [ public static examples = [
'$ balena devices supported', '$ balena devices supported',

View File

@ -80,14 +80,16 @@ export default class EnvsCmd extends Command {
service-specific variables. As asterisk in these columns indicates that the service-specific variables. As asterisk in these columns indicates that the
variable applies to "all devices" or "all services". variable applies to "all devices" or "all services".
If you are parsing the output in a script, please select the JSON format with The --json option is recommended when scripting the output of this command,
the '-j' option. This avoids future compatibility issues if columns are added, because the JSON format is less likely to change and it better represents data
renamed or reordered. Also, when the JSON format is selected, an empty JSON types like lists and empty strings. The 'jq' utility may be helpful in shell
array ([]) is printed instead of an error message when no variables exist for scripts (https://stedolan.github.io/jq/manual/). When --json is used, an empty
the given query. When querying variables for a device, note that the application JSON array ([]) is printed instead of an error message when no variables exist
name may be null in JSON output (or 'N/A' in tabular output) if the application for the given query. When querying variables for a device, note that the
linked to the device is no longer accessible by the current user (for example, application name may be null in JSON output (or 'N/A' in tabular output) if the
in case the current user has been removed from the application by its owner). application linked to the device is no longer accessible by the current user
(for example, in case the current user has been removed from the application
by its owner).
`; `;
public static examples = [ public static examples = [
'$ balena envs --application MyApp', '$ balena envs --application MyApp',

View File

@ -34,8 +34,11 @@ export default class VersionCmd extends Command {
Display version information for the balena CLI and/or Node.js. Display version information for the balena CLI and/or Node.js.
Display version information for the balena CLI and/or Node.js. Display version information for the balena CLI and/or Node.js.
If you intend to parse the output, please use the -j option for
JSON output, as its format is more stable. The --json option is recommended when scripting the output of this command,
because the JSON format is less likely to change and it better represents
data types like lists and empty strings. The 'jq' utility may be helpful
in shell scripts (https://stedolan.github.io/jq/manual/).
`; `;
public static examples = [ public static examples = [
'$ balena version', '$ balena version',

View File

@ -37,6 +37,9 @@ export async function run(
// shared options, and performs node version requirement checks. // shared options, and performs node version requirement checks.
globalInit(); globalInit();
await routeCliFramework(cliArgs, options); await routeCliFramework(cliArgs, options);
// Windows fix: reading from stdin prevents the process from exiting
process.stdin.pause();
} }
/** /**

View File

@ -50,7 +50,7 @@
"package": "npm run build:fast && npm run build:standalone && npm run build:installer", "package": "npm run build:fast && npm run build:standalone && npm run build:installer",
"release": "ts-node --type-check -P automation/tsconfig.json automation/run.ts release", "release": "ts-node --type-check -P automation/tsconfig.json automation/run.ts release",
"pretest": "npm run build", "pretest": "npm run build",
"test": "mocha -r ts-node/register \"tests/**/*.spec.ts\"", "test": "mocha --timeout 6000 -r ts-node/register \"tests/**/*.spec.ts\"",
"test:fast": "npm run build:fast && npm run test", "test:fast": "npm run build:fast && npm run test",
"ci": "npm run test && catch-uncommitted", "ci": "npm run test && catch-uncommitted",
"watch": "gulp watch", "watch": "gulp watch",