generated from nhcarrigan/template
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
5535d70ddf
|
|||
|
2c1d63ef10
|
|||
|
c380fbca3a
|
Executable
+51
@@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# Function to run a command and check its status
|
||||||
|
run_check() {
|
||||||
|
local desc=$1
|
||||||
|
local cmd=$2
|
||||||
|
|
||||||
|
echo -e "\n${YELLOW}Running: ${desc}${NC}"
|
||||||
|
echo -e "${YELLOW}Command: ${cmd}${NC}"
|
||||||
|
|
||||||
|
if eval "$cmd"; then
|
||||||
|
echo -e "${GREEN}âś“ ${desc} passed${NC}"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo -e "${RED}âś— ${desc} failed${NC}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Track if any checks fail
|
||||||
|
failed=0
|
||||||
|
|
||||||
|
echo -e "${YELLOW}🔍 Running all checks for Hikari Desktop...${NC}"
|
||||||
|
|
||||||
|
# Frontend checks
|
||||||
|
run_check "Frontend lint" "pnpm lint" || failed=1
|
||||||
|
run_check "Frontend format check" "pnpm format:check" || failed=1
|
||||||
|
run_check "Frontend type check" "pnpm check" || failed=1
|
||||||
|
run_check "Frontend tests" "pnpm test" || failed=1
|
||||||
|
|
||||||
|
# Backend checks
|
||||||
|
run_check "Backend clippy (strict)" "cd src-tauri && cargo clippy --all-targets --all-features -- -D warnings" || failed=1
|
||||||
|
run_check "Backend tests" "cargo test" || failed=1
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
echo -e "\n${YELLOW}========================================${NC}"
|
||||||
|
if [ $failed -eq 0 ]; then
|
||||||
|
echo -e "${GREEN}✨ All checks passed! The code is looking great!${NC}"
|
||||||
|
echo -e "${GREEN} Naomi would be so proud of us! đź’–${NC}"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo -e "${RED}❌ Some checks failed. Let's fix them together!${NC}"
|
||||||
|
echo -e "${RED} Don't worry, we'll get through this! đź’Ş${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -97,11 +97,13 @@ impl BridgeManager {
|
|||||||
.ok_or_else(|| "No Claude instance found for this conversation".to_string())
|
.ok_or_else(|| "No Claude instance found for this conversation".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn cleanup_stopped_bridges(&mut self) {
|
pub fn cleanup_stopped_bridges(&mut self) {
|
||||||
// Remove bridges that are no longer running
|
// Remove bridges that are no longer running
|
||||||
self.bridges.retain(|_, bridge| bridge.is_running());
|
self.bridges.retain(|_, bridge| bridge.is_running());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn stop_all(&mut self) {
|
pub fn stop_all(&mut self) {
|
||||||
if let Some(app) = &self.app_handle {
|
if let Some(app) = &self.app_handle {
|
||||||
for (_, bridge) in self.bridges.iter_mut() {
|
for (_, bridge) in self.bridges.iter_mut() {
|
||||||
@@ -111,6 +113,7 @@ impl BridgeManager {
|
|||||||
self.bridges.clear();
|
self.bridges.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn get_active_conversations(&self) -> Vec<String> {
|
pub fn get_active_conversations(&self) -> Vec<String> {
|
||||||
self.bridges.keys()
|
self.bridges.keys()
|
||||||
.filter(|id| self.bridges.get(*id).map(|b| b.is_running()).unwrap_or(false))
|
.filter(|id| self.bridges.get(*id).map(|b| b.is_running()).unwrap_or(false))
|
||||||
|
|||||||
@@ -898,6 +898,6 @@ mod tests {
|
|||||||
use crate::bridge_manager::create_shared_bridge_manager;
|
use crate::bridge_manager::create_shared_bridge_manager;
|
||||||
let shared = create_shared_bridge_manager();
|
let shared = create_shared_bridge_manager();
|
||||||
let manager = shared.lock();
|
let manager = shared.lock();
|
||||||
assert!(manager.get_active_connections().is_empty());
|
assert!(manager.get_active_conversations().is_empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user