Qilan2's picture
Update st-free/a.sh
158a4b2 verified
#!/bin/bash
echo '拉取 SillyTavern 仓库'
git clone https://github.com/SillyTavern/SillyTavern -b release
echo '拉取 SillyTavern 仓库 完毕'
cd SillyTavern
ls
echo '删除文件 data config.yaml login.html server-main.js 完毕'
rm -r data config.yaml public/login.html src/server-main.js public/favicon.ico public/st-launcher.ico public/st.ico /public/img
# 提示用户输入源路径
read -p "请输入旧酒馆的路径(结尾带/): " source_path
# 去除路径末尾的斜杠(如果有)
source_path=$(echo "$source_path" | sed 's:/*$::')
# 检查源路径是否存在
if [ ! -d "$source_path" ]; then
echo "错误:旧酒馆的路径不存在"
exit 1
fi
# 移动 data 目录
echo "$source_path/data"
if [ -d "$source_path/data" ]; then
mv "$source_path/data" .
echo "成功移动 data 目录"
else
echo "警告:未找到 data 目录"
fi
# 移动 config.yaml
echo "$source_path/config.yaml"
if [ -f "$source_path/config.yaml" ]; then
mv "$source_path/config.yaml" .
echo "成功移动 config.yaml"
else
echo "警告:未找到 config.yaml"
fi
# 移动 img
echo "$source_path/public/img"
if [ -f "$source_path/public/img" ]; then
mv "$source_path/public/img" public/img/
echo "成功移动 /public/img"
else
echo "警告:未找到 /public/img"
fi
# 移动 index.html
echo "$source_path/public/index.html"
if [ -f "$source_path/public/index.html" ]; then
mv "$source_path/public/index.html" public/
echo "成功移动 index.html"
else
echo "警告:未找到 index.html"
fi
# 执行 wget 下载
echo '开始下载额外文件'
wget -O src/server-main.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/server-main.js'
wget -O src/config.default.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/config.default.js'
wget -O src/endpoints/users-internal.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/users-internal.js'
wget -O src/middleware/ip-whitelist.js 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/ip-whitelist.js'
wget -O public/login.html 'https://huggingface.co/datasets/Qilan2/st-server/raw/main/st-free/login.html'
wget -O public/favicon.ico 'https://huggingface.co/datasets/Qilan2/st-server/resolve/main/st-free/favicon.ico?download=true'
wget -O public/st-launcher.ico 'https://huggingface.co/datasets/Qilan2/st-server/resolve/main/st-free/st-launcher.ico?download=true'
wget -O public/st.ico 'https://huggingface.co/datasets/Qilan2/st-server/resolve/main/st-free/st.ico?download=true'
echo '下载完成'