feat(core): allow passing a path into read workspace config (#5337)
This commit is contained in:
parent
2c58e0337c
commit
c464b7512a
@ -160,13 +160,19 @@ function readFileIfExisting(path: string) {
|
||||
: '';
|
||||
}
|
||||
|
||||
export function readWorkspaceJson(): any {
|
||||
const ws = new Workspaces(appRootPath);
|
||||
return ws.readWorkspaceConfiguration();
|
||||
export function readWorkspaceJson() {
|
||||
return readWorkspaceConfig({
|
||||
format: 'nx',
|
||||
path: appRootPath,
|
||||
});
|
||||
}
|
||||
|
||||
export function readWorkspaceConfig(opts: { format: 'angularCli' | 'nx' }) {
|
||||
const json = readWorkspaceJson();
|
||||
export function readWorkspaceConfig(opts: {
|
||||
format: 'angularCli' | 'nx';
|
||||
path?: string;
|
||||
}) {
|
||||
const ws = new Workspaces(opts.path);
|
||||
const json = ws.readWorkspaceConfiguration();
|
||||
if (opts.format === 'angularCli') {
|
||||
const formatted = toOldFormatOrNull(json);
|
||||
return formatted ?? json;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user