-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular-devkit/schematics-cli): inconsistency in referencing col…
…lection Fixes #12600
- Loading branch information
1 parent
22d01a8
commit 4d4d118
Showing
2 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as path from 'path'; | ||
import { getGlobalVariable } from '../../utils/env'; | ||
import { exec, execAndWaitForOutputToMatch, silentNpm } from '../../utils/process'; | ||
|
||
const packages = require('../../../../../lib/packages').packages; | ||
|
||
export default async function () { | ||
// setup | ||
const argv = getGlobalVariable('argv'); | ||
if (argv.noglobal) { | ||
return; | ||
} | ||
|
||
const startCwd = process.cwd(); | ||
await silentNpm('install', '-g', packages['@angular-devkit/schematics-cli'].tar, '--unsafe-perm'); | ||
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'schematics'); | ||
|
||
// create blank schematic | ||
await exec('schematics', 'schematic', '--name', 'test-schematic'); | ||
|
||
process.chdir(path.join(startCwd, 'test-schematic')); | ||
await execAndWaitForOutputToMatch( | ||
'schematics', | ||
['.:', '--list-schematics'], | ||
/my-full-schematic/, | ||
); | ||
|
||
// restore path | ||
process.chdir(startCwd); | ||
|
||
} |