瀏覽代碼

Replace link with contents

I'm pretty sure git won't let me create a pre-push hook this way
master
Dimitri Merejkowsky 4 年之前
父節點
當前提交
c434c32325
共有 1 個文件被更改,包括 24 次插入1 次删除
  1. +0
    -1
      pre-push-hook
  2. +24
    -0
      pre-push-hook

+ 0
- 1
pre-push-hook 查看文件

@@ -1 +0,0 @@
.git/hooks/pre-push

+ 24
- 0
pre-push-hook 查看文件

@@ -0,0 +1,24 @@
#!/bin/bash

set -e

remote="$1"
url="$2"

z40=0000000000000000000000000000000000000000

while read local_ref local_sha remote_ref remote_sha
do
if [[ "${local_sha}" = $z40 ]]; then
echo "Deleting stuff, nothing to do"
else
(
cd cours
poetry run python build.py --clean --werror
poetry run python build.py --format pdf
poetry run python deploy.py
)
fi
done

git lfs pre-push "$@"