Fix "catch-uncommitted" build failure (npm run prettify)

Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
This commit is contained in:
Paulo Castro 2019-06-07 01:30:32 +01:00
parent 7fccd4a35e
commit d8c942c77e
10 changed files with 14 additions and 42 deletions

View File

@ -137,9 +137,7 @@ export class MarkdownFileParser {
} else {
reject(
new Error(
`Markdown section not found: title="${title}" file="${
this.mdFilePath
}"`,
`Markdown section not found: title="${title}" file="${this.mdFilePath}"`,
),
);
}

View File

@ -88,9 +88,7 @@ async function getAppOwner(sdk: BalenaSDK, appName: string) {
});
const selected = await selectFromList(
`${
entries.length
} applications found with that name, please select the application you would like to push to`,
`${entries.length} applications found with that name, please select the application you would like to push to`,
entries,
);

View File

@ -58,17 +58,13 @@ async function getContainerId(
});
if (request.status !== 200) {
throw new Error(
`There was an error connecting to device ${uuid}, HTTP response code: ${
request.status
}.`,
`There was an error connecting to device ${uuid}, HTTP response code: ${request.status}.`,
);
}
const body = request.body;
if (body.status !== 'success') {
throw new Error(
`There was an error communicating with device ${uuid}.\n\tError: ${
body.message
}`,
`There was an error communicating with device ${uuid}.\n\tError: ${body.message}`,
);
}
containerId = body.services[serviceName];

View File

@ -201,9 +201,7 @@ export const tunnel: CommandDefinition<Args, Options> = {
)
.then(() => {
logger.logInfo(
` - tunnelling ${localAddress}:${localPort} to ${
device.uuid
}:${remotePort}`,
` - tunnelling ${localAddress}:${localPort} to ${device.uuid}:${remotePort}`,
);
return true;

View File

@ -45,9 +45,7 @@ function checkNodeVersion() {
const { stripIndent } = require('common-tags');
console.warn(stripIndent`
------------------------------------------------------------------------------
Warning: Node version "${
process.version
}" does not match required versions "${validNodeVersions}".
Warning: Node version "${process.version}" does not match required versions "${validNodeVersions}".
This may cause unexpected behaviour. To upgrade Node, visit:
https://nodejs.org/en/download/
------------------------------------------------------------------------------

View File

@ -25,9 +25,7 @@ import { exitWithExpectedError } from './utils/patterns';
function routeCliFramework(argv: string[]): void {
if (process.env.DEBUG) {
console.log(
`Debug: original argv0="${process.argv0}" argv=[${argv}] length=${
argv.length
}`,
`Debug: original argv0="${process.argv0}" argv=[${argv}] length=${argv.length}`,
);
}
const cmdSlice = argv.slice(2);

View File

@ -51,9 +51,7 @@ export async function parseRegistrySecrets(
return registrySecrets;
} catch (error) {
return exitWithExpectedError(
`Error validating registry secrets file "${secretsFilename}":\n${
error.message
}`,
`Error validating registry secrets file "${secretsFilename}":\n${error.message}`,
);
}
}
@ -144,9 +142,7 @@ async function performResolution(
buildTask.buildStream = clonedStream;
if (!buildTask.external && !buildTask.resolved) {
throw new Error(
`Project type for service "${
buildTask.serviceName
}" could not be determined. Missing a Dockerfile?`,
`Project type for service "${buildTask.serviceName}" could not be determined. Missing a Dockerfile?`,
);
}
return buildTask;

View File

@ -92,9 +92,7 @@ async function environmentFromInput(
// exists
if (!(match[1] in ret)) {
logger.logDebug(
`Warning: Cannot find a service with name ${
match[1]
}. Treating the string as part of the environment variable name.`,
`Warning: Cannot find a service with name ${match[1]}. Treating the string as part of the environment variable name.`,
);
match[2] = `${match[1]}:${match[2]}`;
} else {
@ -132,9 +130,7 @@ export async function deployToDevice(opts: DeviceDeployOptions): Promise<void> {
await api.ping();
} catch (e) {
exitWithExpectedError(
`Could not communicate with local mode device at address ${
opts.deviceHost
}`,
`Could not communicate with local mode device at address ${opts.deviceHost}`,
);
}

View File

@ -45,13 +45,9 @@ export function stateToString(state: OperationState) {
switch (state.operation.command) {
case 'copy':
return `${result} ${state.operation.from.path} -> ${
state.operation.to.path
}`;
return `${result} ${state.operation.from.path} -> ${state.operation.to.path}`;
case 'replace':
return `${result} ${state.operation.file.path}, ${
state.operation.copy
} -> ${state.operation.replace}`;
return `${result} ${state.operation.file.path}, ${state.operation.copy} -> ${state.operation.replace}`;
case 'run-script':
return `${result} ${state.operation.script}`;
default:

View File

@ -279,9 +279,7 @@ function createRemoteBuildRequest(
if (response.statusCode >= 100 && response.statusCode < 400) {
if (DEBUG_MODE) {
console.log(
`[debug] received HTTP ${response.statusCode} ${
response.statusMessage
}`,
`[debug] received HTTP ${response.statusCode} ${response.statusMessage}`,
);
}
} else {