diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml deleted file mode 100644 index c8bf720..0000000 --- a/.github/workflows/clang-format.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Clang Format & Tidy - -on: - pull_request: - push: - branches: [ main ] - -jobs: - clang-tools: - runs-on: ubuntu-latest - - permissions: - contents: write # Needed to push changes back - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} # checkout the PR branch so we can push back - - - name: Install clang tools - run: | - sudo apt update - sudo apt install -y clang-format clang-tidy - - - name: Run clang-format and auto-fix - run: | - FILES=$(find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp') - clang-format -i $FILES - - - name: Commit and push changes (if any) - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add -u - if ! git diff --cached --quiet; then - git commit -m "Apply clang-format fixes" - git push - else - echo "No formatting changes needed" - fi - diff --git a/webserv/ConfigManager/ConfigManager.cpp b/webserv/config/ConfigManager.cpp similarity index 91% rename from webserv/ConfigManager/ConfigManager.cpp rename to webserv/config/ConfigManager.cpp index 8971f4a..c571bb8 100644 --- a/webserv/ConfigManager/ConfigManager.cpp +++ b/webserv/config/ConfigManager.cpp @@ -1,5 +1,7 @@ #include -#include +#include + + ConfigManager::ConfigManager() : _initialized(false) { diff --git a/webserv/ConfigManager/ConfigManager.hpp b/webserv/config/ConfigManager.hpp similarity index 100% rename from webserv/ConfigManager/ConfigManager.hpp rename to webserv/config/ConfigManager.hpp diff --git a/webserv/config/LocationConfig.cpp b/webserv/config/LocationConfig.cpp new file mode 100644 index 0000000..e69de29 diff --git a/webserv/config/LocationConfig.hpp b/webserv/config/LocationConfig.hpp new file mode 100644 index 0000000..e69de29 diff --git a/webserv/config/ServerConfig.cpp b/webserv/config/ServerConfig.cpp new file mode 100644 index 0000000..e69de29 diff --git a/webserv/config/ServerConfig.hpp b/webserv/config/ServerConfig.hpp new file mode 100644 index 0000000..e69de29 diff --git a/webserv/main.cpp b/webserv/main.cpp index 9aa6511..b419188 100644 --- a/webserv/main.cpp +++ b/webserv/main.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include #include @@ -6,18 +7,13 @@ int main(int argc, char **argv) { - std::vector args; - args.reserve(static_cast(argc)); - for (int i = 0; i < argc; ++i) - { - args.emplace_back(argv[i]); - } - if (args.size() < 2) + if (argc < 2) { - std::cerr << "Usage: " << args[0] << " \n"; + std::cerr << "Usage: " << argv[0] << " \n"; return 1; } - ConfigManager::getInstance().init(args[1]); + ConfigManager::getInstance().init(argv[1]); + return 0; } \ No newline at end of file