diff --git a/internal/phplint/wasm.go b/internal/phplint/wasm.go index 1dd6795f..1ec856ce 100644 --- a/internal/phplint/wasm.go +++ b/internal/phplint/wasm.go @@ -2,6 +2,7 @@ package phplint import ( "context" + "os" "path" "github.com/FriendsOfShopware/shopware-cli/internal/system" @@ -10,7 +11,15 @@ import ( ) func getWazeroRuntime(ctx context.Context) (wazero.Runtime, error) { - cache, err := wazero.NewCompilationCacheWithDir(path.Join(system.GetShopwareCliCacheDir(), "wasm", "cache")) + wazeroCacheDir := path.Join(system.GetShopwareCliCacheDir(), "wasm", "cache") + + if _, err := os.Stat(wazeroCacheDir); os.IsNotExist(err) { + if err := os.MkdirAll(wazeroCacheDir, os.ModePerm); err != nil { + return nil, err + } + } + + cache, err := wazero.NewCompilationCacheWithDir(wazeroCacheDir) if err != nil { return nil, err }