2020-02-14 00:52:16 +01:00
|
|
|
/*
|
2024-09-06 18:56:18 +02:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2020-02-14 00:52:16 +01:00
|
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
|
2024-09-06 18:56:18 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2020-02-14 00:52:16 +01:00
|
|
|
*/
|
|
|
|
|
2024-10-30 19:06:03 +01:00
|
|
|
import path from "node:path";
|
2023-04-18 19:59:12 +02:00
|
|
|
import { rimraf } from "rimraf";
|
2022-01-10 13:57:33 +01:00
|
|
|
|
2024-10-30 19:06:03 +01:00
|
|
|
import type { DependencyInfo } from "./dep.js";
|
|
|
|
import type HakEnv from "./hakEnv.js";
|
2020-02-14 00:52:16 +01:00
|
|
|
|
2021-12-14 15:32:27 +01:00
|
|
|
export default async function clean(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
2023-04-06 14:41:38 +02:00
|
|
|
await rimraf(moduleInfo.moduleDotHakDir);
|
|
|
|
await rimraf(path.join(hakEnv.dotHakDir, "links", moduleInfo.name));
|
|
|
|
await rimraf(path.join(hakEnv.projectRoot, "node_modules", moduleInfo.name));
|
2020-02-14 00:52:16 +01:00
|
|
|
}
|