Skip to content

Commit d8736a9

Browse files
committed
first commit
0 parents  commit d8736a9

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/build/
2+
*.o
3+
*.out
4+
*.exe
5+
/.cache/
6+
/.vscode/

CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
project(syncsh LANGUAGES CXX)
3+
include(CMakePrintHelpers)
4+
set(CMAKE_CXX_STANDARD 20)
5+
set(CMAKE_CXX_STANDARD_REQUIRED True)
6+
set(CMAKE_DEBUG_POSTFIX d)
7+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
9+
10+
# Get /src/ files
11+
file(GLOB_RECURSE MAIN_SOURCES CONFIGURE_DEPENDS
12+
"src/*.cpp"
13+
"src/*.hpp"
14+
)
15+
16+
# Find packages
17+
18+
# Define common libraries used by both main executable and tests
19+
set(COMMON_LIBRARIES
20+
21+
)
22+
23+
# Main exec
24+
add_executable(${PROJECT_NAME} ${MAIN_SOURCES})
25+
target_link_libraries(${PROJECT_NAME} PUBLIC
26+
${COMMON_LIBRARIES}
27+
)
28+
29+
# Catch2 testing
30+
file(GLOB_RECURSE TEST_SOURCES CONFIGURE_DEPENDS
31+
"tests/*.cpp"
32+
)
33+
find_package(Catch2 REQUIRED)
34+
include(Catch)
35+
add_executable(${PROJECT_NAME}_tests ${TEST_SOURCES})
36+
target_link_libraries(${PROJECT_NAME}_tests PRIVATE
37+
Catch2::Catch2WithMain
38+
${COMMON_LIBRARIES}
39+
)

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
# syncsh
3+
4+
## Design
5+
6+
PC1
7+
8+
1. Pick folder
9+
2. Checksum/sign, zip, compress, encrypt
10+
3. Upload to remote (git)
11+
12+
PC2
13+
14+
1. git pull
15+
2. Checksum/check signature, unzip, decompress, decrypt
16+
17+
Problems
18+
19+
1. Managing/storing encryption keys automatically
20+
2. Managing what files to sync
21+
3. Having a nice, simple, intuitive interface for those
22+
4. Managing when to git pull and check for sync
23+
5. Managing git rep, when to upload, how to create, etc...
24+
25+
Do I need a 3rd party for this?
26+
27+
Should I go P2P?
28+
29+
I want it to be hosted by a 3rd party and easy to access
30+
I prefer github, I should keep it open to implement more in the future
31+
I want the simplest usage/ux possible without having to fiddle
32+
I want the most robust design possible preventing breakage
33+
Github already has version control so its best to do update the same folder in the same repo
34+
Transferable to every pc without breakage
35+
36+
What is more robust: Create a new folder for the repo or use a repo in the folder with gitignore everything but the encrypted zip?
37+
I'll go with the 1st
38+

src/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#include <iostream>
3+
4+
int main() {
5+
6+
std::cout << "Start" << std::endl;
7+
8+
9+
10+
std::cout << "End" << std::endl;
11+
12+
return 0;
13+
}

tests/sanity.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#define CATCH_CONFIG_MAIN
2+
#include <catch2/catch_test_macros.hpp>
3+
4+
int sum(int x, int y) { return x + y; }
5+
6+
TEST_CASE("Sanity sum test", "[catch]") {
7+
8+
REQUIRE(sum(1, 1) == 2);
9+
REQUIRE(sum(2, 2) == 4);
10+
}

0 commit comments

Comments
 (0)