Build a Build Script Help

I’m stuck on step 9 of this project in the Web Development Path:

I’ve watched the get help video and my code looks identical to the video’s, but I keep printing the source/ file to build.

This is my code:

echo "Hello"

firstline=$(head -n 1 source/
echo $firstline

read -a splitfirstline <<< $firstline 


echo "You are building version" $version

echo 'Do you want to continue? (enter "1" for yes, "0" for no)'

read versioncontinue

if [ $versioncontinue -eq 1 ]
  echo "OK"

  for filename in source/*
   echo $filename

  if [ $filename == “source/” ]
   echo "Not copying" $filename
   echo "Copying" $filename
   cp $filename build

 echo "Please come back when you are ready."

And this is the output:

Copying source/bar.js
Copying source/

Hi ruby9951660504,

I think the issue is in your if statement, bash does not recognise this kind of that you used there (look at the syntax highlighting in the editor in the course: it would be yellow if it was recognised as a string). Try replacing them with the " that you have used in the rest of your script, and I think this would resolve your issue.

All the best,

Thank you so much, that fixed it! :grinning:

1 Like