mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-14 08:01:02 -07:00
remove extraction of the first dir into the top level for github release extensions (#9247)
This commit is contained in:
@@ -273,24 +273,6 @@ export async function downloadFromGitHubRelease(
|
|||||||
|
|
||||||
extractFile(downloadedAssetPath, destination);
|
extractFile(downloadedAssetPath, destination);
|
||||||
|
|
||||||
const files = await fs.promises.readdir(destination);
|
|
||||||
const extractedDirName = files.find((file) => {
|
|
||||||
const filePath = path.join(destination, file);
|
|
||||||
return fs.statSync(filePath).isDirectory();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (extractedDirName) {
|
|
||||||
const extractedDirPath = path.join(destination, extractedDirName);
|
|
||||||
const extractedDirFiles = await fs.promises.readdir(extractedDirPath);
|
|
||||||
for (const file of extractedDirFiles) {
|
|
||||||
await fs.promises.rename(
|
|
||||||
path.join(extractedDirPath, file),
|
|
||||||
path.join(destination, file),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await fs.promises.rmdir(extractedDirPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
await fs.promises.unlink(downloadedAssetPath);
|
await fs.promises.unlink(downloadedAssetPath);
|
||||||
return {
|
return {
|
||||||
tagName: releaseData.tag_name,
|
tagName: releaseData.tag_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user