diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..408a490 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "devops" + pull_request: + branches: [ main ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: g++ -std=c++17 main.cpp \ No newline at end of file diff --git a/README.md b/README.md index bbcf55a..3b1bc38 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build C++](https://github.com/EdJaPe/autovalidate/actions/workflows/compile.yml/badge.svg)](https://github.com/EdJaPe/autovalidate/actions/workflows/compile.yml) + # autovalidate I like that app too! diff --git a/main.cpp b/main.cpp index 690cf17..baf1e8e 100644 --- a/main.cpp +++ b/main.cpp @@ -23,8 +23,15 @@ int main(){ srand(time(0)); pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; - input = get_input_in_lowercase(); - cout << VALIDATION[pick] << "! Let's listen to more\n"; + + getline(cin,input); + if (input == "nothing"){ + return 0; + }else{ + transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); + cout << VALIDATION[pick] << "! Let's listen to more\n"; + } + do{ cout << "What's next?\n";