1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42: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") {
homeDir, _ := os.UserHomeDir()
appendVSCodeConfig(cfgFile, "vscode", filepath.Join(homeDir, ".vscode/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "codium", filepath.Join(homeDir, ".vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "codeoss", filepath.Join(homeDir, ".config/Code - OSS/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "cursor", filepath.Join(homeDir, ".cursor/extensions/local.dynamic-base16-dankshell-0.0.1"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "windsurf", filepath.Join(homeDir, ".windsurf/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"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "codeoss", filepath.Join(homeDir, ".config/Code - OSS/extensions"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "cursor", filepath.Join(homeDir, ".cursor/extensions"), opts.ShellDir)
appendVSCodeConfig(cfgFile, "windsurf", filepath.Join(homeDir, ".windsurf/extensions"), opts.ShellDir)
}
if opts.RunUserTemplates {
@@ -428,10 +428,14 @@ func appendTerminalConfig(opts *Options, cfgFile *os.File, tmpDir string, checkC
cfgFile.WriteString("\n")
}
func appendVSCodeConfig(cfgFile *os.File, name, extDir, shellDir string) {
if _, err := os.Stat(extDir); err != nil {
func appendVSCodeConfig(cfgFile *os.File, name, extBaseDir, shellDir string) {
pattern := filepath.Join(extBaseDir, "danklinux.dms-theme-*")
matches, err := filepath.Glob(pattern)
if err != nil || len(matches) == 0 {
return
}
extDir := matches[0]
templateDir := filepath.Join(shellDir, "matugen", "templates")
fmt.Fprintf(cfgFile, `[templates.dms%sdefault]
input_path = '%s/vscode-color-theme-default.json'

View File

@@ -210,21 +210,43 @@ func TestFlatpakInstallationDirCommandFailure(t *testing.T) {
}
func TestAnyFlatpakExistsSomeExist(t *testing.T) {
if !FlatpakInPath() {
t.Skip("flatpak not in PATH")
tempDir := t.TempDir()
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 {
t.Errorf("expected true when at least one flatpak exists")
}
}
func TestAnyFlatpakExistsNoneExist(t *testing.T) {
if !FlatpakInPath() {
t.Skip("flatpak not in PATH")
tempDir := t.TempDir()
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")
if result {
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",
"displayName": "Dynamic Base16 DankShell",
"description": "Dynamic Material You theme with base16 terminal colors - auto-updated by DankMaterialShell",
"publisher": "local",
"version": "0.0.1",
"name": "dms-theme",
"displayName": "DMS - Dank Material Shell Theme",
"description": "Dynamic theme using matugen & dank16 terminal colors - auto-updated by DankMaterialShell",
"publisher": "DankLinux",
"version": "0.0.2",
"icon": "danklogo.png",
"engines": {
"vscode": "^1.70.0"
},
@@ -11,16 +12,15 @@
"Themes"
],
"keywords": [
"theme",
"dms",
"dank",
"material",
"material you",
"base16",
"dynamic",
"dankshell"
"dankshell",
"danklinux"
],
"repository": {
"type": "git",
"url": "https://github.com/AvengeMedia/DankMaterialShellGit"
"url": "https://github.com/AvengeMedia/DankMaterialShell"
},
"contributes": {
"themes": [