diff --git a/src/help.cpp b/src/help.cpp index 9cbcda6..eab851c 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -6,13 +6,14 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/10 13:08:36 by adjoly #+# #+# */ -/* Updated: 2025/04/28 14:29:20 by adjoly ### ########.fr */ +/* Updated: 2025/05/06 16:14:03 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ #include #include #include +#include #include #include #include @@ -28,11 +29,13 @@ void _printHelp(void) { void _generateConf(void) { webserv::Logger _log; - if (access("./sample.conf", F_OK) == 0) { + if (access(SAMPLE_CONF_PATH, F_OK) == 0) { _log.warn(std::string(SAMPLE_CONF_PATH) + " already exist, aborting"); } else { - _log.info("generating config into ./sample.conf..."); - std::ofstream file("./sample.conf"); + std::stringstream str; + str << "generating config into " << SAMPLE_CONF_PATH << "..."; + _log.info(str.str()); + std::ofstream file(SAMPLE_CONF_PATH); if (file.is_open()) { file << "[server]\nhost = \"localhost\"\nport = " "8080\n\n[server.location./]\nmethods = { \"GET\" }\nroot "