mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 05:40:11 -08:00
feat: Enhance package detection and installation process with improved parsing and validation
This commit is contained in:
@@ -25,7 +25,7 @@ echo -e "${BLUE}Checking for packages.list:${NC}"
|
||||
if [ -f "$HOME/shell/setup/packages.list" ]; then
|
||||
echo -e "- packages.list: ${GREEN}Found${NC}"
|
||||
# Count packages in list (excluding comments and empty lines)
|
||||
pkg_count=$(grep -v '^//' "$HOME/shell/setup/packages.list" | grep -v -e '^$' | wc -l)
|
||||
pkg_count=$(grep -v '^//' "$HOME/shell/setup/packages.list" | grep -v -e '^$' | sed 's|//.*||' | awk '{print $1}' | grep -v '^$' | wc -l)
|
||||
echo -e "- Package count: ${GREEN}$pkg_count packages${NC}"
|
||||
else
|
||||
echo -e "- packages.list: ${RED}Not found${NC}"
|
||||
@@ -36,19 +36,19 @@ fi
|
||||
echo -e "${BLUE}Setting up logs directory:${NC}"
|
||||
if [ -d "/logs" ]; then
|
||||
echo -e "- Logs directory: ${GREEN}Found${NC}"
|
||||
|
||||
|
||||
# Check ownership and permissions
|
||||
logs_owner=$(stat -c '%U:%G' /logs)
|
||||
echo -e "- Current ownership: $logs_owner"
|
||||
|
||||
|
||||
echo "- Setting permissions on /logs directory..."
|
||||
sudo chown -R $(whoami):$(whoami) /logs 2>/dev/null || echo -e "${YELLOW}Failed to set ownership${NC}"
|
||||
sudo chmod -R 777 /logs 2>/dev/null || echo -e "${YELLOW}Failed to set permissions${NC}"
|
||||
|
||||
|
||||
# Verify permissions are correct
|
||||
if [ -w "/logs" ]; then
|
||||
echo -e "- Write permission: ${GREEN}OK${NC}"
|
||||
|
||||
|
||||
# Create a test file to really verify we can write
|
||||
if touch "/logs/test_file" 2>/dev/null; then
|
||||
echo -e "- Test write: ${GREEN}Succeeded${NC}"
|
||||
|
||||
Reference in New Issue
Block a user