fix cargo
Some checks failed
Deploy ailog / build-and-deploy (push) Failing after 14m42s

This commit is contained in:
2025-06-11 18:27:58 +09:00
parent ad45b151b1
commit eb5aa0a2be
23 changed files with 214 additions and 70 deletions

27
run.zsh
View File

@ -1,45 +1,40 @@
#!/bin/zsh
# Simple build script for ai.log
# Usage: ./run.zsh [serve|build|oauth|clean|tunnel|all]
function _env() {
d=${0:a:h}
ailog=$d/target/release/ailog
port=4173
case $OSTYPE in
darwin*)
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
;;
esac
}
function _server() {
_env
lsof -ti:4173 | xargs kill -9 2>/dev/null || true
lsof -ti:$port | xargs kill -9 2>/dev/null || true
cd $d/my-blog
cargo build --release
$ailog build
$ailog serve --port 4173
$ailog serve --port $port
}
function _server_public() {
_env
#cloudflared tunnel --config $d/aicard-web-oauth/cloudflared-config.yml run
cloudflared tunnel --config $d/cloudflared-config.yml run
}
function _oauth_build() {
_env
cd $d/aicard-web-oauth
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
nvm use 21
npm i
# Build with production environment variables
export VITE_APP_HOST="https://log.syui.ai"
export VITE_OAUTH_CLIENT_ID="https://log.syui.ai/client-metadata.json"
export VITE_OAUTH_REDIRECT_URI="https://log.syui.ai/oauth/callback"
source .env.production
npm run build
cp -rf dist/* $d/my-blog/static/
#cp -rf dist/index.html $d/my-blog/public/
#npm run preview
}