feat: Improve publish-all.sh script to handle zinit_client
				
					
				
			- Correctly handle the `zinit_client` crate name in package publication checks and messages. The script previously failed to account for the difference between the directory name and the package name. - Improve the clarity of published crate names in output messages for better user understanding. This makes the output more consistent and user friendly.
This commit is contained in:
		| @@ -147,8 +147,14 @@ is_published() { | ||||
|     local crate_name="$1" | ||||
|     local version="$2" | ||||
|  | ||||
|     # Handle special case for zinit_client (directory) -> sal-zinit-client (package) | ||||
|     local package_name="sal-$crate_name" | ||||
|     if [ "$crate_name" = "zinit_client" ]; then | ||||
|         package_name="sal-zinit-client" | ||||
|     fi | ||||
|  | ||||
|     # Use cargo search to check if the exact version exists | ||||
|     if cargo search "sal-$crate_name" --limit 1 | grep -q "sal-$crate_name.*$version"; then | ||||
|     if cargo search "$package_name" --limit 1 | grep -q "$package_name.*$version"; then | ||||
|         return 0  # Already published | ||||
|     else | ||||
|         return 1  # Not published | ||||
| @@ -209,7 +215,12 @@ for crate in "${CRATES[@]}"; do | ||||
|  | ||||
|     # Check if already published | ||||
|     if [ "$DRY_RUN" = false ] && is_published "$crate" "$VERSION"; then | ||||
|         echo -e "${GREEN}  ✅ sal-$crate@$VERSION already published, skipping${NC}" | ||||
|         # Handle special case for zinit_client display name | ||||
|         display_name="sal-$crate" | ||||
|         if [ "$crate" = "zinit_client" ]; then | ||||
|             display_name="sal-zinit-client" | ||||
|         fi | ||||
|         echo -e "${GREEN}  ✅ $display_name@$VERSION already published, skipping${NC}" | ||||
|         echo "" | ||||
|         continue | ||||
|     fi | ||||
| @@ -223,13 +234,24 @@ for crate in "${CRATES[@]}"; do | ||||
|     if [ "$DRY_RUN" = true ]; then | ||||
|         echo -e "${BLUE}  🔍 Would run: cargo publish --allow-dirty${NC}" | ||||
|         if is_published "$crate" "$VERSION"; then | ||||
|             echo -e "${YELLOW}  📝 Note: sal-$crate@$VERSION already exists${NC}" | ||||
|             # Handle special case for zinit_client display name | ||||
|             display_name="sal-$crate" | ||||
|             if [ "$crate" = "zinit_client" ]; then | ||||
|                 display_name="sal-zinit-client" | ||||
|             fi | ||||
|             echo -e "${YELLOW}  📝 Note: $display_name@$VERSION already exists${NC}" | ||||
|         fi | ||||
|     else | ||||
|         # Handle special case for zinit_client display name | ||||
|         display_name="sal-$crate" | ||||
|         if [ "$crate" = "zinit_client" ]; then | ||||
|             display_name="sal-zinit-client" | ||||
|         fi | ||||
|  | ||||
|         if cargo publish --allow-dirty; then | ||||
|             echo -e "${GREEN}  ✅ sal-$crate published successfully${NC}" | ||||
|             echo -e "${GREEN}  ✅ $display_name published successfully${NC}" | ||||
|         else | ||||
|             echo -e "${RED}  ❌ Failed to publish sal-$crate${NC}" | ||||
|             echo -e "${RED}  ❌ Failed to publish $display_name${NC}" | ||||
|             cd .. | ||||
|             restore_dependencies "$crate" | ||||
|             exit 1 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user