#include "readmes.hpp"

#include <fstream>
#include <filesystem>
void dropshell::create_readme_local_config_dir(const std::string &readme_path)
{
    if (std::filesystem::exists(readme_path)) 
       return; // already exists
       
    std::ofstream readme_file(readme_path);
    // use heredoc to write the readme
    readme_file << R"(

use this directory to store your local config files for your servers and services.
  dropshell create-server <server_name>
  dropshell create-template <template_name>
  dropshell create-service <server_name> <template_name> <service_name>

config_path
    |-- servers
    |   |-- server_name
    |       |-- server.env
    |       |-- services
    |           |-- service_name
    |               |-- service.env
    |               |-- (other config files for specific server&service)
    |-- templates
    |   |-- template_name
    |       |-- (script files)
    |       |-- example
    |           |-- service.env
    |           |-- (other service config files)

    )" << std::endl;
    readme_file.close();
}