Small confusion with bash terminal functionality

I’ve just finished the build a build script project but I’m getting some inexplicable error messages. I’ve created an array of all files that are children of the source directory. in the process of iterating through each child file the files are both located; determined, and declared non existant. have I done something wrong? whats happening here?


this is my code

firstline=$(head -n 1 source/changelog.md)
read -a splitfirstline <<< $firstline
version=${splitfirstline[1]}
echo "You are building version" $version
echo "Enter 1 to continue or 0 to exit script."
read number
if [ $number -ne 0 ]
then
  echo "OK"
  for files in source/*
  do
    echo $files
    if [$files == "source/secretinfo.md"] 
    then
      echo "Not copying" $files
    else
      echo "Copying" $files
      cp $files build/.
    fi
  done
  cd build/
  echo "Build version $version contains" ls
  cd ..
else
  echo "Please come back when you are ready"
fi