Skip to content

Commit 2aa183a

Browse files
author
hastmu
committed
merge latest installer to release
2 parents eec685c + 33b8354 commit 2aa183a

File tree

6 files changed

+558
-10
lines changed

6 files changed

+558
-10
lines changed

.githooks/post-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
#set -e
4+
5+
source ".pre-commit.state"
6+
7+
for item in "${!CHANGED[@]}"
8+
do
9+
mv "${CHANGED["${item}"]}" "${item}"
10+
done
11+

.githooks/pre-commit

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
6+
echo "" > .pre-commit.state
7+
echo "" > .pre-commit.state.log
8+
9+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
10+
declare -A CHANGED=()
11+
12+
for item in "$(git diff --name-only --cached)"
13+
do
14+
echo "item: ${item}" >&2
15+
found=0
16+
if [[ ${item} =~ \.md$ ]] || [ "${item}" == "install.deb.sh" ]
17+
then
18+
echo "CHANGED: ${item}" >&2
19+
CHANGED["${item}"]="${item}.$(uuidgen)"
20+
cp -a "${item}" "${CHANGED["${item}"]}"
21+
cp -a "${item}" "${item}.template"
22+
git add "${item}.template"
23+
# change file as needed
24+
sed -i "s:@branch@:${BRANCH}:g" "${item}"
25+
diff "${item}" "${CHANGED["${item}"]}" >> .pre-commit.state.log || true
26+
git status >> .pre-commit.state.log || true
27+
git add "${item}" || true
28+
git status >> .pre-commit.state.log || true
29+
fi
30+
done
31+
32+
declare -p CHANGED >> .pre-commit.state
33+
34+
# git branch
35+
# pwd
36+
# env | grep -i git

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ Reading state information... Done
102102

103103
So the quickest way is:
104104
```
105-
curl -s https://raw.githubusercontent.com/hastmu/apt-proxy-detect/refs/heads/release/v1.0.0/install.deb.sh | sudo BRANCH=release/v1.0.0 bash
105+
curl -s https://raw.githubusercontent.com/hastmu/apt-proxy-detect/refs/heads/@branch@/install.deb.sh | sudo BRANCH=@branch@ bash
106106
```
107107

108108
looks like
109109

110110
```
111-
dev@dev~#> curl -s https://raw.githubusercontent.com/hastmu/apt-proxy-detect/refs/heads/release/v1.0.0/install.deb.sh | sudo BRANCH=release/v1.0.0 bash
112-
- BRANCH [release/v1.0.0]
111+
dev@dev~#> curl -s https://raw.githubusercontent.com/hastmu/apt-proxy-detect/refs/heads/@branch@/install.deb.sh | sudo BRANCH=@branch@ bash
112+
- BRANCH [@branch@]
113113
- downloading ... ok.
114114
dpkg-deb: building package 'apt-proxy-detect' in 'apt-proxy-detect_1.0.0_1730626377.deb'.
115115
Reading package lists... Done

0 commit comments

Comments
 (0)