我想制作一个bat文件,它将抓取一个git存储库并将其下载到特定目录。批处理文件意外退出
运行此脚本时,我得到的错误是:
' was unexpected at this time.
这里是我的代码:
@echo off
TITLE Starter Kit
cls
echo "Note: This script will download the 'CodeKit-Starter-Kit' repository from @NicholasAdamou's GitHub."
set /p response="Do you want to continue? <y/n>"
if /i "%response%"=="y" (
goto :downloadKit
:downloadKit
cls
echo "Downloading the CodeKit-Starter-Kit repository from @NicholasAdamou's GitHub."
set "filePath=%~dp0"
cd %filePath%
cd ../dist
git clone https://github.com/NicholasAdamou/CodeKit-Starter-Kit.git 'StarterKit (CodeKit)'
)
if /i "%response%"=="n" (
call exit
)
感谢您的回答......它更有意义。 –
不是绝对可以肯定的,但据我记忆,'git'也可以接受双引号,所以这也应该可以工作:'git clone https://github.com/NicholasAdamou/CodeKit-Starter-Kit.git“StarterKit CodeKit)“';所以没有必要逃避任何事情...... – aschipfl