private async getSpawnProcessOptions()

in src/azService.ts [147:169]


    private async getSpawnProcessOptions() {
        if (process.platform === 'darwin') {
            try {
                const which = await exec('which az');
                const binPath = await realpath(which.stdout.trim());
                const cellarBasePath = '/usr/local/Cellar/azure-cli/';
                if (binPath.startsWith(cellarBasePath)) {
                    const installPath = binPath.substr(0, binPath.indexOf('/', cellarBasePath.length));
                    const libPath = `${installPath}/libexec/lib`;
                    const entries = await readdir(libPath);
                    for (const entry of entries) {
                        const packagesPath = `${libPath}/${entry}/site-packages`;
                        if (await exists(packagesPath)) {
                            return { env: { 'PYTHONPATH': packagesPath } };
                        }
                    }
                }
            } catch (err) {
                console.error(err);
            }
        }
        return undefined;
    }