From 59cb786bc1da620df8b896ab3726acc6dae003b6 Mon Sep 17 00:00:00 2001 From: Matt Bierner <12821956+mjbvz@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:07:52 -0800 Subject: [PATCH] Copy over .sh scripts in git extension too Fixes #299332 Restoring previous webpack behavior. In the future let's consider just moving these to the `git/scripts` folder so we don't have to copy them around --- extensions/git/esbuild.mts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/extensions/git/esbuild.mts b/extensions/git/esbuild.mts index 35c8f6c63f0..1b397880bc6 100644 --- a/extensions/git/esbuild.mts +++ b/extensions/git/esbuild.mts @@ -2,12 +2,27 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import { run } from '../esbuild-extension-common.mts'; const srcDir = path.join(import.meta.dirname, 'src'); const outDir = path.join(import.meta.dirname, 'dist'); +async function copyNonTsFiles(outDir: string): Promise { + const entries = await fs.readdir(srcDir, { withFileTypes: true, recursive: true }); + for (const entry of entries) { + if (!entry.isFile() || entry.name.endsWith('.ts')) { + continue; + } + const srcPath = path.join(entry.parentPath, entry.name); + const relativePath = path.relative(srcDir, srcPath); + const destPath = path.join(outDir, relativePath); + await fs.mkdir(path.dirname(destPath), { recursive: true }); + await fs.copyFile(srcPath, destPath); + } +} + run({ platform: 'node', entryPoints: { @@ -17,4 +32,4 @@ run({ }, srcDir, outdir: outDir, -}, process.argv); +}, process.argv, copyNonTsFiles);