Fix duplication of new paths

This commit is contained in:
2024-08-13 10:25:22 +02:00
parent 1d71fe5aca
commit 205d4029be
2 changed files with 10 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
_ "github.com/mattn/go-sqlite3"
@@ -96,8 +97,10 @@ func main() {
continue
}
newEntry := Entry{
FolderURI: path.Clean(path.Join(folder, fileEntry.Name())),
FolderURI: filepath.ToSlash(path.Clean(path.Join(folder, fileEntry.Name()))),
}
// Lowercase disk letters... Because it's what vscode would have wanted
newEntry.FolderURI = strings.ToLower(newEntry.FolderURI[:1]) + newEntry.FolderURI[1:]
_, exists := cleanConfig[newEntry.FolderURI]
if exists {
log.Printf("Folder %s already exists in config", newEntry.FolderURI)