Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/release/process-release.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable no-console */
import fsp from 'fs/promises';
import path from 'path';

import dotenv from 'dotenv';
import execa from 'execa';
import { emptyDir, copy } from 'fs-extra';
import { copy, remove } from 'fs-extra';
import semver from 'semver';
import type { ReleaseType } from 'semver';

Expand Down Expand Up @@ -110,6 +111,14 @@ async function updateOpenApiTools(
);
}

async function emptyDirExceptForDotGit(dir: string): Promise<void> {
for (const file of await fsp.readdir(dir)) {
if (file !== '.git') {
await remove(path.resolve(dir, file));
}
}
}

async function updateChangelog({
lang,
issueBody,
Expand Down Expand Up @@ -206,7 +215,7 @@ async function processRelease(): Promise<void> {
});

const clientPath = toAbsolutePath(getLanguageFolder(lang));
await emptyDir(tempGitDir);
await emptyDirExceptForDotGit(tempGitDir);
await copy(clientPath, tempGitDir, { preserveTimestamps: true });

await configureGitHubAuthor(tempGitDir);
Expand Down