MCPcopy Index your code
hub / github.com/angular/angular-cli / getWorkspaceRaw

Function getWorkspaceRaw

packages/angular/cli/src/utilities/config.ts:220–238  ·  view source on GitHub ↗
(
  level: 'local' | 'global' = 'local',
)

Source from the content-addressed store, hash-verified

218 * NB: This method is intended to be used only for `ng config`.
219 */
220export async function getWorkspaceRaw(
221 level: 'local' | 'global' = 'local',
222): Promise<[JSONFile | null, string | null]> {
223 let configPath = level === 'local' ? await projectFilePath() : globalFilePath();
224
225 if (!configPath) {
226 if (level === 'global') {
227 configPath = defaultGlobalFilePath;
228 // Config doesn't exist, force create it.
229
230 const globalWorkspace = await getWorkspace('global');
231 await globalWorkspace.save();
232 } else {
233 return [null, null];
234 }
235 }
236
237 return [new JSONFile(configPath), configPath];
238}
239
240export async function validateWorkspace(data: json.JsonObject, isGlobal: boolean): Promise<void> {
241 const schema = readAndParseJson(workspaceSchemaPath);

Callers 2

runMethod · 0.90
setMethod · 0.90

Calls 4

projectFilePathFunction · 0.85
globalFilePathFunction · 0.85
getWorkspaceFunction · 0.70
saveMethod · 0.45

Tested by

no test coverage detected