From a70a563f2d16c556cc6967647f1712641e46a9f6 Mon Sep 17 00:00:00 2001 From: adjoly Date: Tue, 6 May 2025 16:14:22 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E2=9C=A8=E3=80=8D=20feat:=20changed?= =?UTF-8?q?=20to=20use=20the=20define?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/help.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 "