diff --git a/apps/remixdesktop/src/plugins/circomElectronBasePlugin.ts b/apps/remixdesktop/src/plugins/circomElectronBasePlugin.ts index cb4f317d56..6c7b63a493 100644 --- a/apps/remixdesktop/src/plugins/circomElectronBasePlugin.ts +++ b/apps/remixdesktop/src/plugins/circomElectronBasePlugin.ts @@ -1,6 +1,6 @@ import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron" import { Profile } from "@remixproject/plugin-utils" -import { getInstallationPath, circomCli, extractParentFromKey, getInstallationUrl, getLogInputSignalsPath } from "../tools/circom" +import { getInstallationPath, circomCli, extractParentFromKey, getInstallationUrl, getLogInputSignalsPath, extractNameFromKey } from "../tools/circom" import path from "path" import { existsSync, readFileSync } from "fs" @@ -57,7 +57,7 @@ class CircomElectronPluginClient extends ElectronBasePluginClient { // @ts-ignore if (process.platform === 'win32' && 'wasm' in options) { // @ts-ignore - await this.call('fs', 'rmdir', path.join(extractParentFromKey(filePath), '.bin', 'simple_js')) + await this.call('fs', 'rmdir', path.join(extractParentFromKey(filePath), '.bin', extractNameFromKey(filePath).replace('.circom', '_js'))) } } filePath = path.join(wd, filePath) diff --git a/apps/remixdesktop/src/tools/circom.ts b/apps/remixdesktop/src/tools/circom.ts index b15c668e67..a6cbb1651b 100644 --- a/apps/remixdesktop/src/tools/circom.ts +++ b/apps/remixdesktop/src/tools/circom.ts @@ -127,3 +127,10 @@ export const extractParentFromKey = (key: string):string => { return keyPath.join('/') } + +export const extractNameFromKey = (key: string): string => { + if (!key) return + const keyPath = key.split('/') + + return keyPath[keyPath.length - 1] +}