@@ -97,28 +97,21 @@ export class ConfigCommandModule
97
97
throw new CommandModuleError ( 'Invalid Path.' ) ;
98
98
}
99
99
100
- const validCliPaths = new Map <
101
- string ,
102
- ( ( arg : string | number | boolean | undefined ) => string ) | undefined
103
- > ( [
104
- [ 'cli.warnings.versionMismatch' , undefined ] ,
105
- [ 'cli.defaultCollection' , undefined ] ,
106
- [ 'cli.schematicCollections' , undefined ] ,
107
- [ 'cli.packageManager' , undefined ] ,
108
- [ 'cli.analytics' , undefined ] ,
109
-
110
- [ 'cli.analyticsSharing.tracking' , undefined ] ,
111
- [ 'cli.analyticsSharing.uuid' , ( v ) => ( v === '' ? uuidV4 ( ) : `${ v } ` ) ] ,
112
-
113
- [ 'cli.cache.enabled' , undefined ] ,
114
- [ 'cli.cache.environment' , undefined ] ,
115
- [ 'cli.cache.path' , undefined ] ,
100
+ const validGlobalCliPaths = new Set < string > ( [
101
+ 'cli.warnings.versionMismatch' ,
102
+ 'cli.defaultCollection' ,
103
+ 'cli.schematicCollections' ,
104
+ 'cli.packageManager' ,
105
+
106
+ 'cli.analytics' ,
107
+ 'cli.analyticsSharing.tracking' ,
108
+ 'cli.analyticsSharing.uuid' ,
116
109
] ) ;
117
110
118
111
if (
119
112
options . global &&
120
113
! options . jsonPath . startsWith ( 'schematics.' ) &&
121
- ! validCliPaths . has ( options . jsonPath )
114
+ ! validGlobalCliPaths . has ( options . jsonPath )
122
115
) {
123
116
throw new CommandModuleError ( 'Invalid Path.' ) ;
124
117
}
@@ -130,7 +123,13 @@ export class ConfigCommandModule
130
123
throw new CommandModuleError ( 'Confguration file cannot be found.' ) ;
131
124
}
132
125
133
- const value = validCliPaths . get ( options . jsonPath ) ?.( options . value ) ?? options . value ;
126
+ const normalizeUUIDValue = ( v : string | undefined ) => ( v === '' ? uuidV4 ( ) : `${ v } ` ) ;
127
+
128
+ const value =
129
+ options . jsonPath === 'cli.analyticsSharing.uuid'
130
+ ? normalizeUUIDValue ( options . value )
131
+ : options . value ;
132
+
134
133
const modified = config . modify ( parseJsonPath ( options . jsonPath ) , normalizeValue ( value ) ) ;
135
134
136
135
if ( ! modified ) {
0 commit comments