-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup_gtest.sh
More file actions
54 lines (42 loc) Β· 941 Bytes
/
cleanup_gtest.sh
File metadata and controls
54 lines (42 loc) Β· 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
echo "π§Ή Restoring default Replit C++ environment..."
# Remove GTest + CMake structure
rm -rf build src tests
rm -f CMakeLists.txt .clangd run_main.sh run_tests.sh run_select.sh
rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake
rm -f main_app test_runner libadd_lib.a
# Restore default .replit
cat > .replit << 'EOF'
run = "./main"
compile = "make"
EOF
# Restore default replit.nix
cat > replit.nix << 'EOF'
{ pkgs }: {
deps = [ pkgs.gcc ];
}
EOF
# Restore default Makefile
cat > Makefile << 'EOF'
CC = g++
CFLAGS = -std=c++17 -Wall
TARGET = main
all: \$(TARGET)
\$(TARGET): main.cpp
\$(CC) \$(CFLAGS) main.cpp -o \$(TARGET)
clean:
rm -f \$(TARGET)
EOF
# Restore main.cpp if missing
if [ ! -f main.cpp ]; then
cat > main.cpp << 'EOF'
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
EOF
fi
make
./main
echo "π Cleanup complete! Default C++ project restored."