extism / cli

The extism CLI is used to generate plugin scaffolding and manage Extism installations
BSD 3-Clause "New" or "Revised" License
19 stars 5 forks source link

fix: Change default `prefix` on Windows #46

Closed mhmd-azeez closed 7 months ago

mhmd-azeez commented 7 months ago

Currently, the default prefix is /usr/local on all platforms. On Windows, there is no clear equivalent of /usr/local/lib or /usr/local/lib. Here are some options:

Current behavior:

PS D:\x\cli> extism lib install
Installing v0.5.5 to /usr/local
Fetching https://github.com/extism/extism/releases/download/v0.5.5/libextism-x86_64-pc-windows-msvc-v0.5.5.tar.gz
Copying extism.dll to \usr\local\lib\extism.dll
Copying extism.h to \usr\local\include\extism.h
PS D:\x\cli> cd d:\usr\local\lib\
PS D:\usr\local\lib> ls

    Directory: D:\usr\local\lib

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          11/30/2023  4:41 PM       13258240 extism.dll

Note how it got installed in D:\usr\local\lib which is not what a Windows user expects.

New behavior:

PS D:\dylibso\cli\extism> go run main.go lib install
Installing v0.5.5 to .
Fetching https://github.com/extism/extism/releases/download/v0.5.5/libextism-x86_64-pc-windows-msvc-v0.5.5.tar.gz
Copying extism.dll to lib\extism.dll
Copying extism.h to include\extism.h
PS D:\dylibso\cli\extism> cd .\lib\
PS D:\dylibso\cli\extism\lib> ls

    Directory: D:\dylibso\cli\extism\lib

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          11/30/2023  4:43 PM       13258240 extism.dll

I thinks this makes the CLI much more predictable on Windows