Update load.ts

This commit is contained in:
Test 2024-10-15 17:59:05 -07:00
parent 2bb97f4bb9
commit f8087289b9

View file

@ -551,7 +551,7 @@ async function promptEsbuildInstallation(ide: IDE): Promise<boolean> {
/**
* The download logic is adapted from here: https://esbuild.github.io/getting-started/#download-a-build
*/
async function downloadAndInstallEsbuild() {
async function downloadAndInstallEsbuild(ide: IDE) {
const esbuildPath = getEsbuildBinaryPath();
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "esbuild-"));
@ -606,6 +606,11 @@ async function downloadAndInstallEsbuild() {
// Clean up
fs.unlinkSync(tgzPath);
fs.rmSync(tempDir, { recursive: true });
await ide.showToast(
"info",
`'esbuild' successfully installed to ${esbuildPath}`,
);
} catch (error) {
console.error("Error downloading or saving esbuild binary:", error);
throw error;