DavesCodeMusings / mpremote-vscode

Visual Studio Code extension for mpremote Python module
BSD 2-Clause "Simplified" License
10 stars 1 forks source link

Consolidate Python executable detection into a single function #17

Closed DavesCodeMusings closed 7 months ago

DavesCodeMusings commented 8 months ago

Currently, utility.ts and mpremote.ts are both running code similar to the following to detect the appropriate Python executable based on the operating system:

    let pythonBinary = 'py.exe';  // Assume this is a Windows system for now.
    if (process.platform !== 'win32') {  // win32 is returned for 64-bit OS as well
        pythonBinary = 'python';
    }
    console.debug('Using Python executable:', pythonBinary);

Ideally, this code would be in a function (probably residing in utility.ts) that could be shared.

Implementing this before issue #16 would make issue #16 a single change in one file rather than two.

DavesCodeMusings commented 7 months ago

Implemented in 1.21.4