| 197 | // *********************************************************************** |
| 198 | |
| 199 | void GenerateProject(String projectName) { |
| 200 | // check if directory already exists for the project |
| 201 | String projectPath = TempPrint("system/%S/", projectName); |
| 202 | if (FolderExists(projectPath)) { |
| 203 | Log::Warn("Project with name %s already exists", projectName.pData); |
| 204 | return; |
| 205 | } |
| 206 | |
| 207 | // create directory for project name |
| 208 | MakeDirectory(projectPath, true); |
| 209 | |
| 210 | // create a main.lua template |
| 211 | String mainLuaFile = TempPrint("%S%s", projectPath, "main.luau"); |
| 212 | WriteWholeFile(mainLuaFile, templateProject.pData, templateProject.length); |
| 213 | |
| 214 | Log::Info("Project '%s' created successfully", projectName.pData); |
| 215 | } |
| 216 | |
| 217 | // *********************************************************************** |
| 218 | |