Skip to content

Commit ee3cd18

Browse files
committed
simple repl
1 parent c82bc34 commit ee3cd18

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/main.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ int main() {
66
std::cout << std::unitbuf;
77
std::cerr << std::unitbuf;
88

9-
// Uncomment this block to pass the first stage
10-
std::cout << "$ ";
11-
129
std::string input;
13-
std::getline(std::cin, input);
14-
std::cout << input << ": command not found" << std::endl;
10+
while(true) {
11+
std::cout << "$ ";
12+
std::getline(std::cin, input);
13+
if (input == "") {
14+
break;
15+
}
16+
std::cout << input << ": command not found" << std::endl;
17+
}
1518
}

your_program.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ set -e # Exit early if any commands fail
1414
# - Edit .codecrafters/compile.sh to change how your program compiles remotely
1515
(
1616
cd "$(dirname "$0")" # Ensure compile steps are run within the repository directory
17-
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
17+
export VCPKG_ROOT="/Users/daniithompson/vcpkg"
18+
export SDKROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
19+
cmake -B build -S . \
20+
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
21+
-DCMAKE_OSX_SYSROOT=$SDKROOT
1822
cmake --build ./build
1923
)
2024

0 commit comments

Comments
 (0)