From 41edac5826fbe5eebfd0f56ffb2e70c4c1017a28 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Tue, 30 Aug 2022 22:11:58 +0800 Subject: [PATCH] fix: convert driver name while generate lang --- .github/workflows/auto_lang.yml | 1 + cmd/lang.go | 6 +++--- internal/driver/item.go | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto_lang.yml b/.github/workflows/auto_lang.yml index b1df9252c91..5c249152e51 100644 --- a/.github/workflows/auto_lang.yml +++ b/.github/workflows/auto_lang.yml @@ -7,6 +7,7 @@ on: paths: - 'drivers/**' - 'internal/bootstrap/data/setting.go' + workflow_dispatch: jobs: auto_lang: diff --git a/cmd/lang.go b/cmd/lang.go index 0610a4da9bc..e376b1d9c04 100644 --- a/cmd/lang.go +++ b/cmd/lang.go @@ -37,9 +37,9 @@ func convert(s string) string { func generateDriversJson() { drivers := make(Drivers) drivers["drivers"] = make(KV[interface{}]) - driverItemsMap := operations.GetDriverInfoMap() - for k, v := range driverItemsMap { - drivers["drivers"][k] = k + driverInfoMap := operations.GetDriverInfoMap() + for k, v := range driverInfoMap { + drivers["drivers"][k] = convert(k) items := make(KV[interface{}]) for i := range v.Additional { item := v.Additional[i] diff --git a/internal/driver/item.go b/internal/driver/item.go index 150e897a673..d39e72b8999 100644 --- a/internal/driver/item.go +++ b/internal/driver/item.go @@ -28,11 +28,11 @@ type IRootFolderId interface { } type RootFolderPath struct { - RootFolder string `json:"root_folder" required:"true" help:"root folder path"` + RootFolder string `json:"root_folder" required:"true" help:"Root folder path"` } type RootFolderId struct { - RootFolder string `json:"root_folder" required:"true" help:"root folder id"` + RootFolder string `json:"root_folder" required:"true" help:"Root folder id"` } func (r RootFolderPath) GetRootFolderPath() string {