@san-siva/gitsy 1.0.17 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/g-pull CHANGED
@@ -69,9 +69,11 @@ main() {
69
69
  print_message "${BLUE}Fetching changes...${NC}" 1
70
70
  fetch_changes "$target_branch"
71
71
  pull_changes "$target_branch" 2
72
+ sync_submodules 3
72
73
  exit 0
73
74
  fi
74
75
  pull_changes "$target_branch" 1
76
+ sync_submodules 2
75
77
  }
76
78
 
77
79
 
package/bin/g-rmf CHANGED
@@ -60,6 +60,7 @@ main() {
60
60
  validate_dependencies git figlet lolcat
61
61
  print_banner
62
62
  stash_changes true 1 "$tag_message"
63
+ sync_submodules 2
63
64
  }
64
65
 
65
66
 
package/bin/g-rto CHANGED
@@ -53,6 +53,7 @@ main() {
53
53
 
54
54
  reset_to_target_branch "$target_branch" 3
55
55
  pull_changes "$target_branch" 4
56
+ sync_submodules 5
56
57
  }
57
58
 
58
59
 
package/bin/utils CHANGED
@@ -638,6 +638,29 @@ get_repo_name() {
638
638
  return 0
639
639
  }
640
640
 
641
+ sync_submodules() {
642
+ local step_number=$1
643
+
644
+ if [ -z "$step_number" ]; then
645
+ step_number=0
646
+ fi
647
+
648
+ # Skip if no submodules exist
649
+ if [ ! -f ".gitmodules" ] || ! grep -q '\[submodule' .gitmodules 2>/dev/null; then
650
+ return 0
651
+ fi
652
+
653
+ print_message "${BLUE}Syncing submodules...${NC}" $step_number
654
+
655
+ if ! git -c color.ui=always submodule update --init 2>&1 | indent; then
656
+ print_message "" -1
657
+ print_message "${RED}Failed to sync submodules. [Fail]${NC}" -1
658
+ exit 1
659
+ fi
660
+
661
+ print_message "${GREEN}Submodules synced successfully.${NC}" 0
662
+ }
663
+
641
664
  get_repo_info() {
642
665
  local -n git_root_ref=$1
643
666
  local -n current_dir_ref=$2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@san-siva/gitsy",
3
- "version": "1.0.17",
3
+ "version": "1.0.20",
4
4
  "description": "A set of bash utilities for managing Git repositories with ease",
5
5
  "keywords": [
6
6
  "git",