fix cargo version gh-actions

This commit is contained in:
2025-08-09 18:13:27 +09:00
parent 824aee7b74
commit 5708e9c53d
6 changed files with 48 additions and 7 deletions

View File

@@ -48,6 +48,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Rust - name: Setup Rust
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "ailog" name = "ailog"
version = "0.3.2" version = "0.3.3"
edition = "2021" edition = "2021"
authors = ["syui"] authors = ["syui"]
description = "A static blog generator with AI features" description = "A static blog generator with AI features"

View File

@@ -1,6 +1,6 @@
{ {
"name": "ailog-oauth", "name": "ailog-oauth",
"version": "0.3.2", "version": "0.3.3",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -1,6 +1,6 @@
{ {
"name": "pds-browser", "name": "pds-browser",
"version": "0.3.2", "version": "0.3.3",
"description": "AT Protocol browser for ai.log", "description": "AT Protocol browser for ai.log",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",

View File

@@ -20,9 +20,49 @@ function _env() {
function _deploy_ailog() { function _deploy_ailog() {
} }
function _sync_versions() {
# Get version from Cargo.toml
local version=$(grep '^version = ' "$d/Cargo.toml" | cut -d'"' -f2)
if [[ -z "$version" ]]; then
echo "⚠️ Could not find version in Cargo.toml"
return 1
fi
echo " Syncing versions to $version"
# Update oauth/package.json
if [[ -f "$d/oauth/package.json" ]]; then
if command -v jq >/dev/null 2>&1; then
local temp_file=$(mktemp)
jq --arg version "$version" '.version = $version' "$d/oauth/package.json" > "$temp_file"
mv "$temp_file" "$d/oauth/package.json"
echo "✅ Updated oauth/package.json to $version"
else
sed -i.bak "s/\"version\":[[:space:]]*\"[^\"]*\"/\"version\": \"$version\"/" "$d/oauth/package.json"
rm -f "$d/oauth/package.json.bak"
echo "✅ Updated oauth/package.json to $version (sed)"
fi
fi
# Update pds/package.json
if [[ -f "$d/pds/package.json" ]]; then
if command -v jq >/dev/null 2>&1; then
local temp_file=$(mktemp)
jq --arg version "$version" '.version = $version' "$d/pds/package.json" > "$temp_file"
mv "$temp_file" "$d/pds/package.json"
echo "✅ Updated pds/package.json to $version"
else
sed -i.bak "s/\"version\":[[:space:]]*\"[^\"]*\"/\"version\": \"$version\"/" "$d/pds/package.json"
rm -f "$d/pds/package.json.bak"
echo "✅ Updated pds/package.json to $version (sed)"
fi
fi
}
function _server() { function _server() {
lsof -ti:$port | xargs kill -9 2>/dev/null || true lsof -ti:$port | xargs kill -9 2>/dev/null || true
cd $d/my-blog cd $d/my-blog
_sync_versions
cargo build --release cargo build --release
cp -rf $ailog $CARGO_HOME/bin/ cp -rf $ailog $CARGO_HOME/bin/
$ailog build $ailog build

View File

@@ -70,10 +70,10 @@ async fn communicate_with_claude_mcp(
// Claude Code MCPプロセスを起動 // Claude Code MCPプロセスを起動
// Use the full path to avoid shell function and don't use --continue // Use the full path to avoid shell function and don't use --continue
let claude_executable = if claude_code_path == "claude" { let claude_executable = if claude_code_path == "claude" {
// Use $HOME environment variable instead of hardcoded path // Use dirs crate for cross-platform home directory detection
match std::env::var("HOME") { match dirs::home_dir() {
Ok(home) => format!("{}/.claude/local/claude", home), Some(home) => home.join(".claude/local/claude").to_string_lossy().to_string(),
Err(_) => "/Users/syui/.claude/local/claude".to_string(), // fallback None => "/Users/syui/.claude/local/claude".to_string(), // fallback
} }
} else { } else {
claude_code_path.to_string() claude_code_path.to_string()