Skip to content

Commit 6ab44d8

Browse files
clydindgp1130
authored andcommitted
build: remove template string helpers from validation scripts
The helpers are unneeded and behavior can be reproduced with direct string usage. Also, this removes a runtime dependency on the packages being validated.
1 parent 9f4e818 commit 6ab44d8

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

scripts/validate-build-files.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { logging, tags } from '@angular-devkit/core';
9+
import { logging } from '@angular-devkit/core';
1010
import { existsSync } from 'fs';
1111
import { join } from 'path';
1212
import { packages } from '../lib/packages';
@@ -24,10 +24,10 @@ export default async function (_options: {}, logger: logging.Logger) {
2424

2525
// There should be at least one BUILD file next to each package.json.
2626
if (!existsSync(join(pkg.root, 'BUILD')) && !existsSync(join(pkg.root, 'BUILD.bazel'))) {
27-
logger.error(tags.oneLine`
28-
The package ${JSON.stringify(pkgName)} does not have a BUILD file associated to it. You
29-
must either set an exception or make sure it can be built using Bazel.
30-
`);
27+
logger.error(
28+
`The package ${JSON.stringify(pkgName)} does not have a BUILD file associated to it.\n` +
29+
'You must either set an exception or make sure it can be built using Bazel.',
30+
);
3131
error = true;
3232
}
3333
}

scripts/validate.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { logging, tags } from '@angular-devkit/core';
9+
import { logging } from '@angular-devkit/core';
1010
import { execSync } from 'child_process';
1111
import templates from './templates';
1212
import validateBuildFiles from './validate-build-files';
@@ -28,10 +28,9 @@ export default async function (options: { verbose: boolean }, logger: logging.Lo
2828
const templateLogger = logger.createChild('templates');
2929
await templates({}, templateLogger);
3030
if (execSync(`git status --porcelain`).toString()) {
31-
logger.error(tags.oneLine`
32-
Running templates updated files... Please run "devkit-admin templates" before submitting
33-
a PR.
34-
`);
31+
logger.error(
32+
'Running templates updated files... Please run "devkit-admin templates" before submitting a PR.',
33+
);
3534
if (!options.verbose) {
3635
process.exit(2);
3736
}

0 commit comments

Comments
 (0)