Learn Bash by Building a Boilerplate - build a Boilerplate

Hi all,

Every time I conclude one task, all my files and directories created suddenly vanish and I need to reset it again. Basically, I needed to reset the console after every single completion.

Anyone who experienced the same issue and knows how to fix it?

Just after completing a task:

After pressing “Continue”:

That is a pain in the butt. Other than reporting a bug or following troubleshooting tips in the forum or working the lesson locally***(my favorite) there is one thing that I did. I created a bash script that saves a copy of the files to to the learn-sql… directory and then copy’s them back from that directory if one of the files is missing. I take no responsibility if you use this script, use at your own risk. If you make it better, I would love to see that. This doesn’t seem like too much work compared to 140 to over 200 lessons when all you need to do if call the script after it has been set up.

  1. create the file named save_copy_work.sh in the current working directory
  2. Add the files you want to save the save_copy_work.sh script
  3. move save_copy_work.sh to ./learn-sql-by-building-a-student-database-part-1 directory
  4. run (from the current directory)./learn-sql-by-building-a-student-database-part-1/save_copy_work.sh In order to save your work
  5. if any of your files disappears then run (from the current directory) ./learn-sql-by-building-a-student-database-part-1/save_copy_work.sh In order recreate your files
# FILE NAME: save_copy_work.sh
# RUN COMAND: ./learn-sql-by-building-a-student-database-part-1/save_copy_work.sh
# a bash script that lets you save your files or replace your missing files with your already stored copies.

# check if all the files exist
if [[ -f <file_1> && -f <file_2> ]]
# If the files exist then save or overwrite (-f option) each of 
# the files to the learn-sql... directory
  cp -f <file_1> learn-sql-by-building-a-student-database-part-1/<file_1>
  cp -f <file_2> learn-sql-by-building-a-student-database-part-1/<file_2>
#  else copy and overwrite the already saved files  to the current directory  
# ***you have to run this file first to save the files or else you don't have any files to begin with!***
  cp -f learn-sql-by-building-a-student-database-part-1/<file_1> <file_1> 
  cp -f learn-sql-by-building-a-student-database-part-1/<file_2> <file_2> 

Wait a minute, so it is actually a common problem?

I don’t know if it’s common but I’ve had it happen to me where the files disappear. Luckily we can use freeCodeCamp locally.

I’m having this happen to me right now. Very annoying to have to reset the lesson every time.