mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-27 12:32:37 +02:00
Factor out common config setup functions in demo package
This commit is contained in:
parent
26989ce0ee
commit
b1bc437d1b
@ -11,7 +11,7 @@ var AmendOldCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
config.UserConfig.Gui.ShowFileTree = false
|
config.UserConfig.Gui.ShowFileTree = false
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
|
@ -11,7 +11,7 @@ var Bisect = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateFile("my-file.txt", "myfile content")
|
shell.CreateFile("my-file.txt", "myfile content")
|
||||||
|
@ -11,7 +11,7 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateNCommitsWithRandomMessages(50)
|
shell.CreateNCommitsWithRandomMessages(50)
|
||||||
|
@ -11,7 +11,7 @@ var CommitAndPush = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateFile("my-file.txt", "myfile content")
|
shell.CreateFile("my-file.txt", "myfile content")
|
||||||
|
@ -11,14 +11,8 @@ var CommitGraph = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
config.UserConfig.Gui.AuthorColors = map[string]string{
|
setGeneratedAuthorColours(config)
|
||||||
"Fredrica Greenhill": "#fb5aa3",
|
|
||||||
"Oscar Reuenthal": "#86c82f",
|
|
||||||
"Paul Oberstein": "#ffd500",
|
|
||||||
"Siegfried Kircheis": "#fe7e11",
|
|
||||||
"Yang Wen-li": "#8e3ccb",
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateRepoHistory()
|
shell.CreateRepoHistory()
|
||||||
|
@ -24,9 +24,7 @@ var CustomCommand = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(cfg *config.AppConfig) {
|
SetupConfig: func(cfg *config.AppConfig) {
|
||||||
// No idea why I had to use version 2: it should be using my own computer's
|
setDefaultDemoConfig(cfg)
|
||||||
// font and the one iterm uses is version 3.
|
|
||||||
cfg.UserConfig.Gui.NerdFontsVersion = "2"
|
|
||||||
|
|
||||||
cfg.UserConfig.CustomCommands = []config.CustomCommand{
|
cfg.UserConfig.CustomCommands = []config.CustomCommand{
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ var CustomPatch = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(cfg *config.AppConfig) {
|
SetupConfig: func(cfg *config.AppConfig) {
|
||||||
cfg.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(cfg)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateNCommitsWithRandomMessages(30)
|
shell.CreateNCommitsWithRandomMessages(30)
|
||||||
|
@ -11,7 +11,7 @@ var Filter = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateNCommitsWithRandomMessages(30)
|
shell.CreateNCommitsWithRandomMessages(30)
|
||||||
|
@ -11,7 +11,7 @@ var InteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateFile("my-file.txt", "myfile content")
|
shell.CreateFile("my-file.txt", "myfile content")
|
||||||
|
@ -11,7 +11,7 @@ var NukeWorkingTree = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
config.UserConfig.Gui.AnimateExplosion = true
|
config.UserConfig.Gui.AnimateExplosion = true
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
|
@ -11,7 +11,7 @@ var RebaseOnto = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateNCommitsWithRandomMessages(60)
|
shell.CreateNCommitsWithRandomMessages(60)
|
||||||
|
19
pkg/integration/tests/demo/shared.go
Normal file
19
pkg/integration/tests/demo/shared.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package demo
|
||||||
|
|
||||||
|
import "github.com/jesseduffield/lazygit/pkg/config"
|
||||||
|
|
||||||
|
// Gives us nicer colours when we generate a git repo history with `shell.CreateRepoHistory()`
|
||||||
|
func setGeneratedAuthorColours(config *config.AppConfig) {
|
||||||
|
config.UserConfig.Gui.AuthorColors = map[string]string{
|
||||||
|
"Fredrica Greenhill": "#fb5aa3",
|
||||||
|
"Oscar Reuenthal": "#86c82f",
|
||||||
|
"Paul Oberstein": "#ffd500",
|
||||||
|
"Siegfried Kircheis": "#fe7e11",
|
||||||
|
"Yang Wen-li": "#8e3ccb",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setDefaultDemoConfig(config *config.AppConfig) {
|
||||||
|
// demos look much nicers with icons shown
|
||||||
|
config.UserConfig.Gui.NerdFontsVersion = "3"
|
||||||
|
}
|
@ -39,7 +39,7 @@ var StageLines = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
config.UserConfig.Gui.ShowFileTree = false
|
config.UserConfig.Gui.ShowFileTree = false
|
||||||
config.UserConfig.Gui.ShowCommandLog = false
|
config.UserConfig.Gui.ShowCommandLog = false
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ var Undo = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(config *config.AppConfig) {
|
SetupConfig: func(config *config.AppConfig) {
|
||||||
config.UserConfig.Gui.NerdFontsVersion = "3"
|
setDefaultDemoConfig(config)
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateNCommitsWithRandomMessages(30)
|
shell.CreateNCommitsWithRandomMessages(30)
|
||||||
|
@ -11,9 +11,7 @@ var WorktreeCreateFromBranches = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
Skip: false,
|
Skip: false,
|
||||||
IsDemo: true,
|
IsDemo: true,
|
||||||
SetupConfig: func(cfg *config.AppConfig) {
|
SetupConfig: func(cfg *config.AppConfig) {
|
||||||
// No idea why I had to use version 2: it should be using my own computer's
|
setDefaultDemoConfig(cfg)
|
||||||
// font and the one iterm uses is version 3.
|
|
||||||
cfg.UserConfig.Gui.NerdFontsVersion = "2"
|
|
||||||
},
|
},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shell.CreateNCommitsWithRandomMessages(30)
|
shell.CreateNCommitsWithRandomMessages(30)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user