appledoc- runcript- ожидаемый конец строки, но найденный идентификатор

Я пытаюсь запустить этот скрипт как часть создания документации с помощью плагина appledoc. Но я получаю этот "Ожидаемый конец строки, но найденный идентификатор". ошибка, когда я запускаю этот скрипт в Xcode(или терминале). Пожалуйста, помогите мне, поскольку я новичок в написании сценариев, и я не могу определить точную ошибку в коде!

#!/bin/bash
tmpdir="tmpdocs"
finaldir="docs"

rm -rf $tmpdir
mkdir $tmpdir # we killed this last time, create it to avoid warnings from appledoc

cd ./AppledocTemplates/
git checkout master
git pull origin master
expectedversion=$(./templateversion.sh) # Check repo version
cd ..

##########################################
# Install templates if not current
##########################################
if [ ! -f ~/.appledoc/templateversion.sh ]  #If this file doesn't exist, then need to install templates
then
  cd ./AppledocTemplates/
  ./installtemplates.sh 
  if [ $? -ne 0 ] # Descriptive error message is sent in installtemplates. Just exit with error
  then
    exit 1
  fi
  cd ..
fi

version=$(~/.appledoc/templateversion.sh) # Check installed version

if [ $version -ne $expectedversion ]
then
  echo "Updating templates"
  cd ./AppledocTemplates/
  ./installtemplates.sh #wrong version - try installing
  version=$(~/.appledoc/templateversion.sh)
  if [ $? -ne 0 ] # Descriptive error message is sent in installtemplates. Just exit with error
  then
    cd ..
    exit 1
  fi

  if [ $version -ne $expectedversion ] # Now is the version correct? If not, exit with error
  then
    cd ..
    echo "You do not have the correct version of the appledoc templates"
    echo "Make sure you run installtemplates.sh to put them in their correct location."
    exit 1
  fi
  cd ..
fi

##########################################
# Compile the docs
##########################################

appledoc ./AppledocSettings.plist MySDK # Compile the docs
if [ $? -ne 0 ]
then
  echo "Compile failure of source documents. MySDK doc creation not completed."
  exit 1
fi

##########################################
# Stage docs in proper places and cleanup
##########################################

#Move the docs to final directory
rm -rf $finaldir # clean out whatever was in the final dir
mkdir $finaldir # and recreate it

#Copy the docset file to the docs directory so that it can be loaded into github
cp -a ~/Library/Developer/Shared/Documentation/DocSets/us.MySDK.MySDK-Total-SDK.docset ./$finaldir
if [ $? -ne 0 ]
then
  echo "Unable to copy docset to ./docs" 
  exit 1
fi

# stage the html directories to their final destination
mv -f ./$tmpdir/html/* $finaldir
if [ $? -ne 0 ]
then
  echo "Unable to move html files to ./docs" 
  exit 1
fi

rm -rf $tmpdir #clear out the tmp dir

echo "MySDK doc creation successful."
exit 0

Это снимок экрана журнала, если я запускаю скрипт из терминала Это снимок экрана журнала, если я запускаю скрипт из Xcode

Первый - снимок экрана журнала, если я запускаю скрипт из терминала. Во-вторых, снимок экрана журнала, если я запускаю скрипт из Xcode.

0 ответов

Другие вопросы по тегам