Skip to content

Commit

Permalink
Add temp root cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 5, 2024
1 parent a3e97c0 commit 7e65b6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/knip/src/WorkspaceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export class WorkspaceWorker {
const cwd = this.dir;

const baseOptions = {
rootCwd: this.cwd,
cwd,
manifest: this.manifest,
manifestScriptNames: this.manifestScriptNames,
Expand Down
4 changes: 2 additions & 2 deletions packages/knip/src/plugins/moonrepo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const resolveConfig: ResolveConfig<MoonConfiguration> = async (config, options)
const dependencies = tasks
.map(task => task.command)
.filter(command => command)
.map(command => command.replace('$workspaceRoot', options.cwd))
.map(command => command.replace('$projectRoot', options.configFileDir))
.map(command => command.replace('$workspaceRoot', options.rootCwd!))
.map(command => command.replace('$projectRoot', options.cwd))
.flatMap(command => getDependenciesFromScripts(command, options));
return [...dependencies];
};
Expand Down
1 change: 1 addition & 0 deletions packages/knip/src/types/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { PackageJson } from './package-json.js';
import type { DependencySet } from './workspace.js';

export interface BaseOptions {
rootCwd?: string;
cwd: string;
manifestScriptNames: Set<string>;
dependencies: DependencySet;
Expand Down

0 comments on commit 7e65b6d

Please sign in to comment.