2023-01-03 17:19:20 -05:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
2022-06-01 13:17:49 -07:00
|
|
|
package kms_plugin_assets
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"io/fs"
|
2022-06-06 11:28:24 -07:00
|
|
|
"path"
|
|
|
|
|
"runtime"
|
2022-06-01 13:17:49 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const contentDir = "assets"
|
|
|
|
|
|
|
|
|
|
func FileSystem() fs.FS {
|
|
|
|
|
// Remove the root
|
2022-06-06 11:28:24 -07:00
|
|
|
dir := path.Join(contentDir, runtime.GOOS, runtime.GOARCH)
|
|
|
|
|
f, err := fs.Sub(content, dir)
|
2022-06-01 13:17:49 -07:00
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
return f
|
|
|
|
|
}
|