template static method

String template(
  1. String relativePath
)

Get absolute path for a template file inside the CLI

Implementation

static String template(String relativePath) {
  // Path to the script being executed (bin/kite.dart)
  final scriptDir = p.dirname(Platform.script.toFilePath());

  // Join with the relative path
  final fullPath = p.normalize(p.join(scriptDir, "../$relativePath"));

  if (!File(fullPath).existsSync()) {
    throw Exception("Template not found: $relativePath\nChecked: $fullPath");
  }

  return fullPath;
}