From 6f696a66d35fc6704c4875b4a5031b5ba62c9464 Mon Sep 17 00:00:00 2001 From: Squibid Date: Fri, 17 Oct 2025 12:49:23 -0400 Subject: [PATCH] feat(template): make sure to generate the example.txt in the deploy dir This should've been part of the template archive but WPILIB devs being WPILIB devs they can't build anything that doesn't take 5+ days to wrap your head around. Not to mention their complete lack of any good documentation. --- cmd/template/template.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/cmd/template/template.go b/cmd/template/template.go index 42c7b6a..d3e3540 100644 --- a/cmd/template/template.go +++ b/cmd/template/template.go @@ -140,4 +140,35 @@ func GenerateProject(opts TemplateOptions) { PostGradle: } + + // Generate example deploy file + { + deployPath := filepath.Join(opts.Dir, "src", "main", "deploy") + err := os.Mkdir(deployPath, 0755) + if err != nil { + slog.Error("Failed to make deploy directory", "error", err) + goto PostExampleDeploy + } + + { // Scope it so we can jump over it + var exampleTxt string + switch (opts.Lang) { + case "cpp": + exampleTxt = `Files placed in this directory will be deployed to the RoboRIO into the + 'deploy' directory in the home folder. Use the 'frc::filesystem::GetDeployDirectory' + function from the 'frc/Filesystem.h' header to get a proper path relative to the deploy + directory.` + case "java": + exampleTxt = `Files placed in this directory will be deployed to the RoboRIO into the + 'deploy' directory in the home folder. Use the 'Filesystem.getDeployDirectory' wpilib function + to get a proper path relative to the deploy directory.` + default: + exampleTxt = `Files placed in this directory will be deployed to the RoboRIO into the + 'deploy' directory in the home folder.` + } + + os.WriteFile(deployPath, []byte(exampleTxt), 0644) + } + PostExampleDeploy: + } }