- Removed the legacy teamctl CLI integration, including the associated source code and references in the main module. - Updated the package description to reflect the current functionality without legacy support. - Cleaned up build scripts by removing unnecessary executable permissions and legacy file handling. - Adjusted tests and documentation to remove references to the deprecated CLI.
31 lines
990 B
JavaScript
31 lines
990 B
JavaScript
import { copyFile, mkdir, readdir, rm } from 'node:fs/promises';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const packageRoot = path.resolve(__dirname, '..');
|
|
const srcDir = path.join(packageRoot, 'src');
|
|
const distDir = path.join(packageRoot, 'dist');
|
|
|
|
async function copyRecursive(sourceDir, targetDir) {
|
|
await mkdir(targetDir, { recursive: true });
|
|
const entries = await readdir(sourceDir, { withFileTypes: true });
|
|
|
|
for (const entry of entries) {
|
|
const sourcePath = path.join(sourceDir, entry.name);
|
|
const targetPath = path.join(targetDir, entry.name);
|
|
|
|
if (entry.isDirectory()) {
|
|
await copyRecursive(sourcePath, targetPath);
|
|
continue;
|
|
}
|
|
|
|
if (entry.isFile()) {
|
|
await copyFile(sourcePath, targetPath);
|
|
}
|
|
}
|
|
}
|
|
|
|
await rm(distDir, { recursive: true, force: true });
|
|
await mkdir(distDir, { recursive: true });
|
|
await copyRecursive(srcDir, distDir);
|