freeCodeCamp: Relational Database (Beta) - Bug with the Terminal in 'mkdir' test

Describe the Issue

So I already know how to use BASH pretty well, because I use Linux as my daily driver, and I made a typo when it wanted me to make a directory for “website”

so just did mv websitre website to change the name, and the ls shows the correct name, but the test isn’t working (I’m assuming it’s looking for me to specifically put in mkdir website)

image

this is a screenshot with the last commands and the fail from the test, even after hitting Ctrl+Enter to try and get it read again.

It’s probably not an immediate issue, but it is definitely a bit jarring for someone at least already slightly familiar with terminal and BASH because mv is one of the first things you tend to pick up

EDIT: So i went to reset the lesson, and it also doesn’t clear out the already moved directory, so as far as I can tell the only solution to this issue at the moment is to rm -rf website and then mkdir website again

Affected Page

https://www.freecodecamp.org/learn/relational-database/learn-bash-by-building-a-boilerplate/build-a-boilerplate

Your code

mkdir websitre
mv websitre website

Expected behavior

Expected for the program to see the new “website” directory in the project folder and continue the lesson

Screenshots

No response

System

  • Device: Desktop
  • OS: EndevourOS
  • Browser: Opera
  • Version: 87.0.4390.25

Additional context

I have attempted a few different similar typo issues now in other parts of the lesson, this is definitely just a case of the test is checking for the input, not the actual filenames.

Which is confusing if you have typos and try to fix them. If there was a way to make it so the test would look for the existence of the files when the student presses Ctrl+Enter to redo the test check, that would likely fix the problem

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (25 by maintainers)

Most upvoted comments

ah cool cool i’ll try that

EDIT: ayyyyyy that worked thank you so much

I ran this by one of the team members. You seemed pretty excited to work on this, and like we said, there isn’t really a downside to add this - so if you want to give it a try, go for it.

One thing you mentioned:

const websiteDirectory = await getDirectoryContents('../website');

It already has it, but it’s looking for the wrong folder. When you make the website folder, you’re in Projects already, so the …/ at the beginning will check outside of that folder

I don’t think that’s true. The tests run from projects/freeCodeCamp so you need to go back a level to get to projects

Also, this part of the test you suggested: lastCommand[0] === 'mv' && /styles\.css$/.test(lastCommand[1]); should be: lastCommand[0] === 'mv' && /styles\.css$/.test(lastCommand[2]); I changed the last 1 to 2 - pretty sure it should be like that. The mv command would be mv stiles.css styles.css - which is split by spaces (for the most part), and turned into the lastCommand array.

I know you got this in chat, but the instructions for working on these are here. I recently moved all the tests to the INIT commit, so you should only need to change that one. Let me know if you have any questions.

Sounds good!

I’ll work on that now then thank you

EDIT: so I’m up to the part where I need to get Docker working to test, and I’m having a bit of a time with it. I’m going to come back to it tomorrow, but I should have it completed then!

Just for maybe some help - here’s how I would do it.

-fork the repo and clone it locally, make sure all the changes are pulled in, etc -create and checkout the latest version branch - v1.0.2 -create and checkout a v1.0.3 branch off of that -rebase that branch to the root and edit the INIT commit -make all your test fixes -continue and finish the rebase -push the new branch to your fork -checkout main -create and checkout a new branch off of that - feat/v1.0.3 -update the stuff in there + commit -run coderoad build -commit new json file -push that branch + make a PR

These are tricky to work on, which is another reason I try to limit changes to ones that are really necessary. But those are pretty close to the steps I would take.

If you want to test your changes, here’s what I do - after you push the v1.0.3 branch to your fork… -checkout main -update coderoad.yaml to use your fork and the new version branch + commit -coderoad build + commit the new JSON file -push to your main branch -use this URL to test the changes: https://codeally.io/embed/?repoUrl=https://github.com/bellhuffstutler/learn-bash-by-building-a-boilerplate - you may need to delete any existing VM’s for that project on codeally first - after opening the project to test it, you can look in the repo files to make sure you are using the repo you just created. e.g. look in coderoad.yaml to see if it’s using your fork

Thank you!

Also yeah, I know the …/website part is wrong now, I was just saying that based off the info I was given, and i was told 850 was the test when it was a different test, and I just didn’t edit it, because it was clarified in later messages.

Also thank you for the tip, and I’ll look at the INIT commit after I finish eating and then get to work making the changes.

oh that’s a really smart way to do it and it locks out GUI modifying!

I need to finish the javascript course so I know I can do that lmao

but yeah no that looks like a correct way to do it and I can just see if there are any other lessons that particular code would work in

also thanks for the link! I’ll do that

EDIT: I’m pretty sure most of the touch commands do the same thing, now that I think about it, I’ll look at the code for them next