Skip to content

Commit d9adf7e

Browse files
committed
Re-introduce removal of share/doc to prevent duplicate file names
1 parent 5021ae6 commit d9adf7e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scripts/download-tools.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import { ArchiveFileAsset, Downloadable, Downloader, GitHubReleaseAsset, WebFileAsset } from '@open-cmsis-pack/vsce-helper';
2020
import { PackageJson } from 'type-fest';
21+
import fs from 'node:fs/promises';
22+
import path from 'node:path';
2123

2224
type CmsisPackageJson = PackageJson & {
2325
cmsis: {
@@ -64,6 +66,16 @@ const pyocd : Downloadable = new Downloadable(
6466
},
6567
)
6668

69+
class GDBArchiveFileAsset extends ArchiveFileAsset {
70+
public async copyTo(dest?: string) {
71+
dest = await super.copyTo(dest);
72+
// Remove doc directory as it contains duplicate files (names differ only in case)
73+
// which are not supported by ZIP (VSIX) archives
74+
await fs.rm(path.join(dest, 'share', 'doc'), { recursive: true, force: true });
75+
return dest;
76+
}
77+
}
78+
6779
const gdb : Downloadable = new Downloadable(
6880
'GNU Debugger for Arm', 'gdb',
6981
async (target) => {
@@ -81,7 +93,7 @@ const gdb : Downloadable = new Downloadable(
8193
const asset_name = `arm-gnu-toolchain-${build}-arm-none-eabi-gdb.${ext}`;
8294
const url = new URL(`https://artifacts.tools.arm.com/arm-none-eabi-gdb/${version}/${asset_name}`);
8395
const dlAsset = new WebFileAsset(url, asset_name, version);
84-
const asset = new ArchiveFileAsset(dlAsset, strip);
96+
const asset = new GDBArchiveFileAsset(dlAsset, strip);
8597
return asset;
8698
},
8799
);

0 commit comments

Comments
 (0)