9
9
// tslint:disable:no-global-tslint-disable no-any
10
10
import {
11
11
JsonObject ,
12
- Path ,
13
12
deepCopy ,
14
- dirname ,
15
- join ,
16
13
logging ,
17
- normalize ,
18
14
parseJson ,
19
15
schema ,
20
16
strings as coreStrings ,
21
17
tags ,
22
18
} from '@angular-devkit/core' ;
23
19
import { ExportStringRef } from '@angular-devkit/schematics/tools' ;
24
20
import { readFileSync } from 'fs' ;
21
+ import { dirname , join } from 'path' ;
25
22
import { of , throwError } from 'rxjs' ;
26
23
import { concatMap } from 'rxjs/operators' ;
27
24
import * as yargsParser from 'yargs-parser' ;
@@ -37,8 +34,8 @@ import { insideProject } from '../utilities/project';
37
34
import { convertSchemaToOptions , parseSchema } from './json-schema' ;
38
35
39
36
40
- export interface CommandMap {
41
- [ key : string ] : Path ;
37
+ interface CommandMap {
38
+ [ key : string ] : string ;
42
39
}
43
40
44
41
interface CommandMetadata {
@@ -111,7 +108,7 @@ export async function runCommand(
111
108
112
109
return 1 ;
113
110
}
114
- const cliDir = dirname ( normalize ( commandMapPath ) ) ;
111
+ const cliDir = dirname ( commandMapPath ) ;
115
112
const commandsText = readFileSync ( commandMapPath ) . toString ( 'utf-8' ) ;
116
113
const commandJson = JSON . parse ( commandsText ) as { [ name : string ] : string } ;
117
114
@@ -410,7 +407,7 @@ async function createCommand(metadata: CommandLocation,
410
407
throw new Error ( 'Implementation path is incorrect' ) ;
411
408
}
412
409
413
- const implRef = new ExportStringRef ( implPath , dirname ( normalize ( metadata . path ) ) ) ;
410
+ const implRef = new ExportStringRef ( implPath , dirname ( metadata . path ) ) ;
414
411
415
412
const ctor = implRef . ref as CommandConstructor ;
416
413
0 commit comments