Browse Source

add scripts to simplify submodule updates

marionbarker 2 tháng trước cách đây
mục cha
commit
a6cf3508a8
2 tập tin đã thay đổi với 46 bổ sung0 xóa
  1. 33 0
      scripts/define_common_trio.sh
  2. 13 0
      scripts/update_submodules_trio.sh

+ 33 - 0
scripts/define_common_trio.sh

@@ -0,0 +1,33 @@
+#!/bin/zsh
+
+# copied from Loop where this definition was used by more than one script
+# initially we probably will not need that capability, but does no harm to keep it
+# define parameters and arrays used by more than one script
+#   These are always capitalized
+#      PROJECTS
+
+# include this file in each script using
+#   source scripts/define_commont_trio.sh
+
+# define the TRIO_PROJECTS used by Trio where for Trio the .gitmodules points
+#   to the downstream fork of loopandlearn in all cases
+#
+# The scrips in LoopWorkspace are used to update translations and make
+#   sure the loopandlearn branches are up to date
+# Even though MedtrumKit and EversenseKit are not yet part of dev
+#   it does no harm to update those repositories using this script
+TRIO_PROJECTS=( \
+    loopandlearn:CGMBLEKit:dev \
+    loopandlearn:dexcom-share-client-swift:dev \
+    loopandlearn:G7SensorKit:main \
+    loopandlearn:LibreTransmitter:main \
+    loopandlearn:LoopKit:dev \
+    loopandlearn:MinimedKit:main \
+    loopandlearn:OmniBLE:dev \
+    loopandlearn:OmniKit:main \
+    loopandlearn:RileyLinkKit:dev \
+    loopandlearn:TidepoolService:dev \
+    loopandlearn:DanaKit:dev \
+    loopandlearn:EversenseKit:dev \
+    loopandlearn:MedtrumKit:dev \
+)

+ 13 - 0
scripts/update_submodules_trio.sh

@@ -0,0 +1,13 @@
+#!/bin/zsh
+
+source scripts/define_common_trio.sh
+
+for project in ${TRIO_PROJECTS}; do
+  echo "Updating to $project"
+  IFS=":" read user dir branch <<< "$project"
+  echo "Updating to $branch on $user/$project"
+  cd $dir
+  git checkout $branch
+  git pull
+  cd -
+done