MCPcopy Index your code
hub / github.com/spicetify/cli / insertSidebarConfig

Function insertSidebarConfig

src/apply/apply.go:458–473  ·  view source on GitHub ↗
(jsPath string, flags Flag)

Source from the content-addressed store, hash-verified

456}
457
458func insertSidebarConfig(jsPath string, flags Flag) {
459 if !flags.SidebarConfig {
460 return
461 }
462
463 utils.ModifyFile(jsPath, func(content string) string {
464 utils.ReplaceOnce(
465 &content,
466 `return null!=\w+&&\w+\.totalLength(\?\w+\(\)\.createElement\(\w+,\{contextUri:)(\w+)\.uri`,
467 func(submatches ...string) string {
468 return fmt.Sprintf(`return true%s%s?.uri||""`, submatches[1], submatches[2])
469 })
470
471 return content
472 })
473}
474
475func insertExpFeatures(jsPath string, flags Flag) {
476 if !flags.ExpFeatures {

Callers

nothing calls this directly

Calls 2

ModifyFileFunction · 0.92
ReplaceOnceFunction · 0.92

Tested by

no test coverage detected