Files
larksuite-cli/cmd/init.go
tuxedomm 4d84994ce6 feat: add SetDefaultFS to allow replacing the global filesystem implementation
Change-Id: If5c3e50e84859f9ac4ffceeb0ac3dc7b7330b274
2026-04-20 01:06:20 +08:00

19 lines
491 B
Go

// Copyright (c) 2026 Lark Technologies Pte. Ltd.
// SPDX-License-Identifier: MIT
package cmd
import "github.com/larksuite/cli/internal/vfs"
// SetDefaultFS replaces the global filesystem implementation used by internal
// packages. The provided fs must implement the vfs.FS interface. If fs is nil,
// the default OS filesystem is restored.
//
// Call this before Build or Execute to take effect.
func SetDefaultFS(fs vfs.FS) {
if fs == nil {
fs = vfs.OsFs{}
}
vfs.DefaultFS = fs
}