1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 16:02:51 -05:00

matugen: publish vscode theme to marketplace/ovsix

This commit is contained in:
bbedward
2026-01-04 13:07:23 -05:00
parent 151d695212
commit 76d88517ec
6 changed files with 49 additions and 23 deletions

View File

@@ -309,11 +309,11 @@ output_path = '%s'
if !opts.ShouldSkipTemplate("vscode") { if !opts.ShouldSkipTemplate("vscode") {
homeDir, _ := os.UserHomeDir() homeDir, _ := os.UserHomeDir()
appendVSCodeConfig(cfgFile, "vscode", filepath.Join(homeDir, ".vscode/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir) appendVSCodeConfig(cfgFile, "vscode", filepath.Join(homeDir, ".vscode/extensions"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "codium", filepath.Join(homeDir, ".vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir) appendVSCodeConfig(cfgFile, "codium", filepath.Join(homeDir, ".vscode-oss/extensions"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "codeoss", filepath.Join(homeDir, ".config/Code - OSS/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir) appendVSCodeConfig(cfgFile, "codeoss", filepath.Join(homeDir, ".config/Code - OSS/extensions"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "cursor", filepath.Join(homeDir, ".cursor/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir) appendVSCodeConfig(cfgFile, "cursor", filepath.Join(homeDir, ".cursor/extensions"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "windsurf", filepath.Join(homeDir, ".windsurf/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir) appendVSCodeConfig(cfgFile, "windsurf", filepath.Join(homeDir, ".windsurf/extensions"), opts.ShellDir)
} }
if opts.RunUserTemplates { if opts.RunUserTemplates {
@@ -428,10 +428,14 @@ func appendTerminalConfig(opts *Options, cfgFile *os.File, tmpDir string, checkC
cfgFile.WriteString("\n") cfgFile.WriteString("\n")
} }
func appendVSCodeConfig(cfgFile *os.File, name, extDir, shellDir string) { func appendVSCodeConfig(cfgFile *os.File, name, extBaseDir, shellDir string) {
if _, err := os.Stat(extDir); err != nil { pattern := filepath.Join(extBaseDir, "danklinux.dms-theme-*")
matches, err := filepath.Glob(pattern)
if err != nil || len(matches) == 0 {
return return
} }
extDir := matches[0]
templateDir := filepath.Join(shellDir, "matugen", "templates") templateDir := filepath.Join(shellDir, "matugen", "templates")
fmt.Fprintf(cfgFile, `[templates.dms%sdefault] fmt.Fprintf(cfgFile, `[templates.dms%sdefault]
input_path = '%s/vscode-color-theme-default.json' input_path = '%s/vscode-color-theme-default.json'

View File

@@ -210,21 +210,43 @@ func TestFlatpakInstallationDirCommandFailure(t *testing.T) {
} }
func TestAnyFlatpakExistsSomeExist(t *testing.T) { func TestAnyFlatpakExistsSomeExist(t *testing.T) {
if !FlatpakInPath() { tempDir := t.TempDir()
t.Skip("flatpak not in PATH") fakeFlatpak := filepath.Join(tempDir, "flatpak")
// Script that succeeds only for "app.exists.test"
script := `#!/bin/sh
if [ "$1" = "info" ] && [ "$2" = "app.exists.test" ]; then
exit 0
fi
exit 1
`
err := os.WriteFile(fakeFlatpak, []byte(script), 0755)
if err != nil {
t.Fatalf("failed to create fake flatpak: %v", err)
} }
result := AnyFlatpakExists("com.nonexistent.flatpak", "app.zen_browser.zen", "com.another.nonexistent") originalPath := os.Getenv("PATH")
t.Setenv("PATH", tempDir+":"+originalPath)
result := AnyFlatpakExists("com.nonexistent.flatpak", "app.exists.test", "com.another.nonexistent")
if !result { if !result {
t.Errorf("expected true when at least one flatpak exists") t.Errorf("expected true when at least one flatpak exists")
} }
} }
func TestAnyFlatpakExistsNoneExist(t *testing.T) { func TestAnyFlatpakExistsNoneExist(t *testing.T) {
if !FlatpakInPath() { tempDir := t.TempDir()
t.Skip("flatpak not in PATH") fakeFlatpak := filepath.Join(tempDir, "flatpak")
script := "#!/bin/sh\nexit 1\n"
err := os.WriteFile(fakeFlatpak, []byte(script), 0755)
if err != nil {
t.Fatalf("failed to create fake flatpak: %v", err)
} }
originalPath := os.Getenv("PATH")
t.Setenv("PATH", tempDir+":"+originalPath)
result := AnyFlatpakExists("com.nonexistent.flatpak1", "com.nonexistent.flatpak2") result := AnyFlatpakExists("com.nonexistent.flatpak1", "com.nonexistent.flatpak2")
if result { if result {
t.Errorf("expected false when no flatpaks exist") t.Errorf("expected false when no flatpaks exist")

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -1,9 +1,10 @@
{ {
"name": "dynamic-base16-dankshell", "name": "dms-theme",
"displayName": "Dynamic Base16 DankShell", "displayName": "DMS - Dank Material Shell Theme",
"description": "Dynamic Material You theme with base16 terminal colors - auto-updated by DankMaterialShell", "description": "Dynamic theme using matugen & dank16 terminal colors - auto-updated by DankMaterialShell",
"publisher": "local", "publisher": "DankLinux",
"version": "0.0.1", "version": "0.0.2",
"icon": "danklogo.png",
"engines": { "engines": {
"vscode": "^1.70.0" "vscode": "^1.70.0"
}, },
@@ -11,16 +12,15 @@
"Themes" "Themes"
], ],
"keywords": [ "keywords": [
"theme", "dms",
"dank",
"material", "material",
"material you", "dankshell",
"base16", "danklinux"
"dynamic",
"dankshell"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/AvengeMedia/DankMaterialShellGit" "url": "https://github.com/AvengeMedia/DankMaterialShell"
}, },
"contributes": { "contributes": {
"themes": [ "themes": [