43 lines
1.7 KiB
Bash
43 lines
1.7 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "1. Inicializando Vite React-TS..."
|
|
cd /root/Apps
|
|
npx -y create-vite@latest TestXR_tmp --template react-ts
|
|
rsync -av TestXR_tmp/ TestXR/
|
|
rm -rf TestXR_tmp
|
|
|
|
echo "2. Copiando bibliotecas de importação do SteelXR..."
|
|
mkdir -p /root/Apps/TestXR/src/lib
|
|
cp /root/Apps/tracksteelxr/src/lib/convertIFC.ts /root/Apps/TestXR/src/lib/ 2>/dev/null || echo "convertIFC.ts não encontrado"
|
|
cp /root/Apps/tracksteelxr/src/lib/convertToGLB.ts /root/Apps/TestXR/src/lib/ 2>/dev/null || echo "convertToGLB.ts não encontrado"
|
|
|
|
echo "3. Configurando dependencias..."
|
|
cd /root/Apps/TestXR
|
|
# Para não travar a UI, usamos npm install em silent
|
|
npm install --silent
|
|
npm install --silent three @react-three/fiber @react-three/drei @react-three/xr web-ifc
|
|
|
|
echo "4. Configurando Git..."
|
|
git init
|
|
git config user.email "hermes@reifonas.cloud"
|
|
git config user.name "Hermes"
|
|
echo "_Legacy_Unity/" >> .gitignore
|
|
echo "node_modules/" >> .gitignore
|
|
|
|
echo "5. Criando Repositório Remoto no Gitea..."
|
|
curl -s -X POST "https://git.reifonas.cloud/api/v1/user/repos" \
|
|
-H "accept: application/json" \
|
|
-H "Content-Type: application/json" \
|
|
-u "admtracksteel:@@Gi05Br;;" \
|
|
-d '{"name":"TestXR", "private":true}' || echo "Repo possivelmente já existe"
|
|
|
|
echo "6. Fazendo Push para o Gitea..."
|
|
git remote add origin https://admtracksteel:%40%40Gi05Br%3B%3B@git.reifonas.cloud/admtracksteel/TestXR.git || git remote set-url origin https://admtracksteel:%40%40Gi05Br%3B%3B@git.reifonas.cloud/admtracksteel/TestXR.git
|
|
git add .
|
|
git commit -m "🚀 Inicialização Automática do Laboratório WebXR"
|
|
git branch -M main
|
|
git push -u origin main
|
|
|
|
echo "Pronto! Código enviado para o Gitea."
|