1
0
mirror of https://github.com/strongdm/comply synced 2025-12-06 14:24:12 +00:00

Initial commit

This commit is contained in:
Justin McCarthy
2018-05-11 13:25:46 -07:00
commit 8f7e41ffc8
1038 changed files with 263537 additions and 0 deletions

1
internal/theme/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
themes_bindata.go

28
internal/theme/theme.go Normal file
View File

@@ -0,0 +1,28 @@
package theme
import (
"io/ioutil"
"os"
"path/filepath"
"strings"
)
func SaveTo(themeName, saveDir string) error {
for _, name := range AssetNames() {
prefix := themeName + "/"
if strings.HasPrefix(name, prefix) {
outputName := strings.TrimPrefix(name, prefix)
assetDir, assetFilename := filepath.Split(outputName)
err := os.MkdirAll(filepath.Join(saveDir, assetDir), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(filepath.Join(saveDir, assetDir, assetFilename), MustAsset(name), os.FileMode(0644))
if err != nil {
return err
}
}
}
// TODO
return nil
}