check token file

This commit is contained in:
jason 2025-09-02 23:57:03 +00:00
parent d9fa698632
commit 89031562c6

View File

@ -15,9 +15,8 @@ ifeq ($(strip $(DPP_VERSION)),) # Check if DPP_VERSION is empty (no version foun
# Define include directories for headers # Define include directories for headers
# -I<path> tells the compiler where to look for #include <file.h> or #include <dir/file.h> # -I<path> tells the compiler where to look for #include <file.h> or #include <dir/file.h>
# We assume: # We assume:
# - Your own headers (like ImageProcessor.h) are in 'include/' # - STB headers are in the root project folder
# - STB headers are in 'include/stb/' # - D++ headers are in 'dpp/' (so dpp.h is found via include/dpp/dpp.h)
# - D++ headers are in 'include/dpp/' (so dpp.h is found via include/dpp/dpp.h)
INC_DIRS = -Iinclude -Idpp/ INC_DIRS = -Iinclude -Idpp/
LIB_PATHS = $(DPP_PATH) LIB_PATHS = $(DPP_PATH)
else else
@ -72,7 +71,14 @@ $(OUTPUT_FILE): $(OBJECTS)
@echo "LDFLAGS: $(LDFLAGS)" @echo "LDFLAGS: $(LDFLAGS)"
@mkdir -p $(@D) # Ensure the output binary directory exists (e.g., bin/Linux/release/) @mkdir -p $(@D) # Ensure the output binary directory exists (e.g., bin/Linux/release/)
$(CXX) -o $@ $(OBJECTS) $(LDFLAGS) $(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
cp token.txt $(@D) @if test -f token.txt; then \
echo "Copying token.txt to $(@D)"; \
cp token.txt $(@D); \
else \
echo "Error: token.txt not found! Please create it in the project root. Copy the token when you create your discord bot and paste it in token.txt"; \
exit 1; \
fi
# Rule to compile the object file: # Rule to compile the object file:
# This takes your .cpp source file and compiles it into an object file (.o). # This takes your .cpp source file and compiles it into an object file (.o).