浏览代码

Add pre-commit hook for f-droid

Neeraj Gupta 2 年之前
父节点
当前提交
d1724060df
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      hooks/pre-commit-fdroid

+ 16 - 0
hooks/pre-commit-fdroid

@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Get the current branch
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+# If the current branch is f-droid, echo Hello World
+if [ "$current_branch" = "f-droid" ]; then
+    # Verify that the pubspec.yaml doesn't contain certain words
+    WORDS=("in_app_purchase" "firebase")
+    for word in ${WORDS[@]}; do
+        if grep -q $word pubspec.yaml; then
+            echo "The pubspec.yaml file dependency on '$word', which is not allowed on the f-droid branch."
+            exit 1
+        fi
+    done
+fi