Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Sep 21, 2022
1 parent 54d0bcf commit 9602312
Show file tree
Hide file tree
Showing 41 changed files with 185 additions and 185 deletions.
4 changes: 2 additions & 2 deletions internal/pipes/new/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content("dockerfiles/blank.dockerfile", "botway", botName)
return templates.Content("dockerfiles/blank.dockerfile", "botway", botName, "")
}

func NewBot(m model, l string, platform, lang int) {
Expand Down Expand Up @@ -150,7 +150,7 @@ func NewBot(m model, l string, platform, lang int) {

dotGitIgnoreFile := os.WriteFile(filepath.Join(opts.BotName, ".gitignore"), []byte(dotGitIgnoreFileContent), 0644)
dotGitKeepFile := os.WriteFile(filepath.Join(opts.BotName, "config", ".gitkeep"), []byte(""), 0644)
readmeFile := os.WriteFile(filepath.Join(opts.BotName, "README.md"), []byte(templates.Content("bot-readme.md", "resources", "")), 0644)
readmeFile := os.WriteFile(filepath.Join(opts.BotName, "README.md"), []byte(templates.Content("bot-readme.md", "resources", "", "")), 0644)

if dotGitIgnoreFile != nil {
log.Fatal(dotGitIgnoreFile)
Expand Down
10 changes: 5 additions & 5 deletions templates/discord/c/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/c-discord.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/c-discord.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/c.md", "resources", "")
return templates.Content("discord/c.md", "resources", "", "")
}

func MainCContent() string {
return templates.Content("src/main.c", "discord-c", "")
return templates.Content("src/main.c", "discord-c", "", "")
}

func BWCContent(botName string) string {
return templates.Content("packages/bwc/main.h", "botway", botName)
return templates.Content("packages/bwc/main.h", "botway", botName, "")
}

func RunPsFileContent() string {
return templates.Content("run.ps1", "discord-c", "")
return templates.Content("run.ps1", "discord-c", "", "")
}
18 changes: 9 additions & 9 deletions templates/discord/cpp/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/cmake-discord.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/cmake-discord.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/cpp.md", "resources", "")
return templates.Content("discord/cpp.md", "resources", "", "")
}

func FindDppCmakeContent() string {
return templates.Content("cmake/FindDPP.cmake", "discord-cpp", "")
return templates.Content("cmake/FindDPP.cmake", "discord-cpp", "", "")
}

func BWCPPFileContent(botName string) string {
return templates.Content("packages/bwpp/main.hpp", "botway", botName)
return templates.Content("packages/bwpp/main.hpp", "botway", botName, "")
}

func MainIncludeFileContent() string {
return templates.Content("include/bwbot/bwbot.h", "discord-cpp", "")
return templates.Content("include/bwbot/bwbot.h", "discord-cpp", "", "")
}

func MainCppContent(botName string) string {
return templates.Content("src/main.cpp", "discord-cpp", botName)
return templates.Content("src/main.cpp", "discord-cpp", botName, "")
}

func DotDockerIgnoreContent() string {
return templates.Content(".dockerignore", "discord-cpp", "")
return templates.Content(".dockerignore", "discord-cpp", "", "")
}

func CmakeListsContent(botName string) string {
return templates.Content("CMakeLists.txt", "discord-cpp", botName)
return templates.Content("CMakeLists.txt", "discord-cpp", botName, "")
}

func RunPsFileContent() string {
return templates.Content("run.ps1", "discord-cpp", "")
return templates.Content("run.ps1", "discord-cpp", "", "")
}
8 changes: 4 additions & 4 deletions templates/discord/crystal/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/crystal.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/crystal.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/crystal.md", "resources", "")
return templates.Content("discord/crystal.md", "resources", "", "")
}

func MainCrContent() string {
return templates.Content("src/main.cr", "discord-crystal", "")
return templates.Content("src/main.cr", "discord-crystal", "", "")
}

func ShardFileContent(botName string) string {
return templates.Content("shard.yml", "discord-crystal", botName)
return templates.Content("shard.yml", "discord-crystal", botName, "")
}
8 changes: 4 additions & 4 deletions templates/discord/csharp/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/crystal.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/crystal.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/csharp.md", "resources", "")
return templates.Content("discord/csharp.md", "resources", "", "")
}

func MainCsContent() string {
return templates.Content("src/Main.cs", "discord-csharp", "")
return templates.Content("src/Main.cs", "discord-csharp", "", "")
}

func BotCSharpProj() string {
return templates.Content("discord-csharp.csproj", "discord-csharp", "")
return templates.Content("discord-csharp.csproj", "discord-csharp", "", "")
}
8 changes: 4 additions & 4 deletions templates/discord/dart/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/dart.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/dart.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/dart.md", "resources", "")
return templates.Content("discord/dart.md", "resources", "", "")
}

func MainDartContent() string {
return templates.Content("src/main.dart", "discord-dart", "")
return templates.Content("src/main.dart", "discord-dart", "", "")
}

func PubspecFileContent(botName string) string {
return templates.Content("pubspec.yaml", "discord-dart", botName)
return templates.Content("pubspec.yaml", "discord-dart", botName, "")
}
24 changes: 12 additions & 12 deletions templates/discord/deno/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,49 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/deno.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/deno.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/deno.md", "resources", "")
return templates.Content("discord/deno.md", "resources", "", "")
}

func MainTsContent() string {
return templates.Content("main.ts", "discord-deno", "")
return templates.Content("main.ts", "discord-deno", "", "")
}

func DepsTsContent() string {
return templates.Content("deps.ts", "discord-deno", "")
return templates.Content("deps.ts", "discord-deno", "", "")
}

func CommandsModTsContent() string {
return templates.Content("src/commands/mod.ts", "discord-deno", "")
return templates.Content("src/commands/mod.ts", "discord-deno", "", "")
}

func CommandsPingTsContent() string {
return templates.Content("src/commands/ping.ts", "discord-deno", "")
return templates.Content("src/commands/ping.ts", "discord-deno", "", "")
}

func EventsGuildCreateTsContent() string {
return templates.Content("src/events/guildCreate.ts", "discord-deno", "")
return templates.Content("src/events/guildCreate.ts", "discord-deno", "", "")
}

func EventsInteractionCreateTsContent() string {
return templates.Content("src/events/interactionCreate.ts", "discord-deno", "")
return templates.Content("src/events/interactionCreate.ts", "discord-deno", "", "")
}

func EventsModTsContent() string {
return templates.Content("src/events/mod.ts", "discord-deno", "")
return templates.Content("src/events/mod.ts", "discord-deno", "", "")
}

func EventsReadyTsContent() string {
return templates.Content("src/events/ready.ts", "discord-deno", "")
return templates.Content("src/events/ready.ts", "discord-deno", "", "")
}

func UtilsHelpersTsContent() string {
return templates.Content("src/utils/helpers.ts", "discord-deno", "")
return templates.Content("src/utils/helpers.ts", "discord-deno", "", "")
}

func UtilsLoggerTsContent() string {
return templates.Content("src/utils/logger.ts", "discord-deno", "")
return templates.Content("src/utils/logger.ts", "discord-deno", "", "")
}
6 changes: 3 additions & 3 deletions templates/discord/go/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/go.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/go.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/go.md", "resources", "")
return templates.Content("discord/go.md", "resources", "", "")
}

func MainGoContent() string {
return templates.Content("main.go", "discord-go", "")
return templates.Content("main.go", "discord-go", "", "")
}
20 changes: 10 additions & 10 deletions templates/discord/java/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/gradle.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/gradle.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/java.md", "resources", "")
return templates.Content("discord/java.md", "resources", "", "")
}

func BotlinContent() string {
return templates.Content("packages/botlin/main.kt", "botway", "")
return templates.Content("packages/botlin/main.kt", "botway", "", "")
}

func MainJavaContent() string {
return templates.Content("app/src/main/java/core/Bot.java", "discord-java", "")
return templates.Content("app/src/main/java/core/Bot.java", "discord-java", "", "")
}

func BuildGradleContent() string {
return templates.Content("app/build.gradle", "discord-java", "")
return templates.Content("app/build.gradle", "discord-java", "", "")
}

func GradleWrapperPropsContent() string {
return templates.Content("gradle/wrapper/gradle-wrapper.properties", "discord-java", "")
return templates.Content("gradle/wrapper/gradle-wrapper.properties", "discord-java", "", "")
}

func DotGitattributesContent() string {
return templates.Content(".gitattributes", "discord-java", "")
return templates.Content(".gitattributes", "discord-java", "", "")
}

func GradlewContent() string {
return templates.Content("gradlew", "discord-java", "")
return templates.Content("gradlew", "discord-java", "", "")
}

func GradlewBatContent() string {
return templates.Content("gradlew.bat", "discord-java", "")
return templates.Content("gradlew.bat", "discord-java", "", "")
}

func SettingsGradle() string {
return templates.Content("settings.gradle", "discord-java", "")
return templates.Content("settings.gradle", "discord-java", "", "")
}
20 changes: 10 additions & 10 deletions templates/discord/kotlin/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/gradle.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/gradle.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/kotlin.md", "resources", "")
return templates.Content("discord/kotlin.md", "resources", "", "")
}

func BotlinContent() string {
return templates.Content("packages/botlin/main.kt", "botway", "")
return templates.Content("packages/botlin/main.kt", "botway", "", "")
}

func MainKtContent() string {
return templates.Content("app/src/main/kotlin/core/Bot.kt", "discord-kotlin", "")
return templates.Content("app/src/main/kotlin/core/Bot.kt", "discord-kotlin", "", "")
}

func BuildGradleKtsContent() string {
return templates.Content("app/build.gradle.kts", "discord-kotlin", "")
return templates.Content("app/build.gradle.kts", "discord-kotlin", "", "")
}

func GradleWrapperPropsContent() string {
return templates.Content("gradle/wrapper/gradle-wrapper.properties", "discord-kotlin", "")
return templates.Content("gradle/wrapper/gradle-wrapper.properties", "discord-kotlin", "", "")
}

func DotGitattributesContent() string {
return templates.Content(".gitattributes", "discord-kotlin", "")
return templates.Content(".gitattributes", "discord-kotlin", "", "")
}

func GradlewContent() string {
return templates.Content("gradlew", "discord-kotlin", "")
return templates.Content("gradlew", "discord-kotlin", "", "")
}

func GradlewBatContent() string {
return templates.Content("gradlew.bat", "discord-kotlin", "")
return templates.Content("gradlew.bat", "discord-kotlin", "", "")
}

func SettingsGradleKts() string {
return templates.Content("settings.gradle.kts", "discord-kotlin", "")
return templates.Content("settings.gradle.kts", "discord-kotlin", "", "")
}
12 changes: 6 additions & 6 deletions templates/discord/nim/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/nim.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/nim.dockerfile", hostService), "botway", botName, "discord")
}

func Resources() string {
return templates.Content("discord/nim.md", "resources", "")
return templates.Content("discord/nim.md", "resources", "", "")
}

func MainNimContent() string {
return templates.Content("src/main.nim", "discord-nim", "")
return templates.Content("src/main.nim", "discord-nim", "", "")
}

func BotnimContent(botName string) string {
return templates.Content("packages/botnim/main.nim", "botway", botName)
return templates.Content("packages/botnim/main.nim", "botway", botName, "")
}

func PngFileContent() string {
return templates.Content("assets/facepalm.png", "discord-nim", "")
return templates.Content("assets/facepalm.png", "discord-nim", "", "")
}

func NimbleFileContent() string {
return templates.Content("discord_nim.nimble", "discord-nim", "")
return templates.Content("discord_nim.nimble", "discord-nim", "", "")
}
10 changes: 5 additions & 5 deletions templates/discord/php/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import (
)

func DockerfileContent(botName, hostService string) string {
return templates.Content(fmt.Sprintf("dockerfiles/%s/php.dockerfile", hostService), "botway", botName)
return templates.Content(fmt.Sprintf("dockerfiles/%s/php.dockerfile", hostService), "botway", botName, "discord")
}

func MainPHPContent() string {
return templates.Content("src/main.php", "discord-php", "")
return templates.Content("src/main.php", "discord-php", "", "")
}

func BotwayPHPContent() string {
return templates.Content("packages/bw-php/main.php", "botway", "")
return templates.Content("packages/bw-php/main.php", "botway", "", "")
}

func Resources() string {
return templates.Content("discord/php.md", "resources", "")
return templates.Content("discord/php.md", "resources", "", "")
}

func ComposerFileContent(botName string) string {
return templates.Content("composer.json", "discord-php", botName)
return templates.Content("composer.json", "discord-php", botName, "")
}
Loading

0 comments on commit 9602312

Please sign in to comment.