Skip to content

Commit 3225cd5

Browse files
committed
Add dependency rule
Signed-off-by: Bensuperpc <[email protected]>
1 parent e20f32a commit 3225cd5

File tree

5 files changed

+42
-6
lines changed

5 files changed

+42
-6
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
fetch-depth: 0
3131
- name: "✅ Check bash syntax"
3232
run: sudo make check
33+
- name: "✅ Check dependency"
34+
run: sudo check-dep
3335
- name: "🛠️ Install"
3436
run: sudo make install
3537
- name: "🛠️ update (optional)"

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
fetch-depth: 0
1919
- name: "✅ Check bash syntax"
2020
run: sudo make check
21+
- name: "✅ Check dependency"
22+
run: sudo check-dep
2123
- name: "🛠️ Install"
2224
run: sudo make install
2325
- name: "🛠️ update (optional)"
@@ -26,8 +28,8 @@ jobs:
2628
run: sudo make uninstall
2729
- name: "🛠️ build package"
2830
run: sudo make dist
29-
# - name: "🛠️ build full package"
30-
# run: sudo make dist-full
31+
- name: "🛠️ build full package"
32+
run: sudo make dist-full
3133
- uses: "marvinpinto/action-automatic-releases@latest"
3234
with:
3335
repo_token: "${{ secrets.GITHUB_TOKEN }}"

Makefile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RM := rm
2525

2626
all: install
2727

28-
install:
28+
install: check-dep
2929
@echo "Install libraries..."
3030
sudo ./install.sh --yes
3131
@echo "done"
@@ -60,7 +60,30 @@ dist-full: clean
6060
@echo "$(PROJECT_NAME)-full-$(VERSION).tar.xz done"
6161

6262
check:
63-
find . -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" ! -path "*/cryptr/*" ! -path "*/others-dist/*" -exec $(SHELL) -n {} \;
63+
find . -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" ! -path "*/cryptr/*" ! -path "*/others-dist/*" ! -path "*/bash-scripts/*" ! -path "*/fff/*" -exec $(SHELL) -n {} \;
64+
65+
check-dep:
66+
@echo "Check dependency:"
67+
@echo ""
68+
@bash --version > /dev/null 2>&1 && echo "bash: OK" || echo "bash: Missing"
69+
@parallel --version > /dev/null 2>&1 && echo "parallel: OK" || echo "parallel: Missing"
70+
@find --version > /dev/null 2>&1 && echo "find: OK" || echo "find: Missing"
71+
@xargs --version > /dev/null 2>&1 && echo "xargs: OK" || echo "xargs: Missing"
72+
@git --version > /dev/null 2>&1 && echo "git: OK" || echo "git: Missing"
73+
@docker --version> /dev/null 2>&1 && echo "docker: OK" || echo "docker: Missing"
74+
@openssl version > /dev/null 2>&1 && echo "openssl: OK" || echo "openssl: Missing"
75+
@cryptsetup --version > /dev/null 2>&1 && echo "cryptsetup: OK" || echo "cryptsetup: Missing"
76+
@xz --version > /dev/null 2>&1 && echo "xz: OK" || echo "xz: Missing"
77+
@tar --version > /dev/null 2>&1 && echo "tar: OK" || echo "tar: Missing"
78+
@mount --version > /dev/null 2>&1 && echo "mount: OK" || echo "mount: Missing"
79+
@mkfs.btrfs --version > /dev/null 2>&1 && echo "mkfs.btrfs: OK" || echo "mkfs.btrfs: Missing"
80+
@gource --help > /dev/null 2>&1 && echo "gource: OK" || echo "gource: Missing"
81+
@youtube-dl --version > /dev/null 2>&1 && echo "youtube-dl: OK" || echo "youtube-dl: Missing"
82+
@ffmpeg -version > /dev/null 2>&1 && echo "ffmpeg: OK" || echo "ffmpeg: Missing"
83+
@cwebp -version > /dev/null 2>&1 && echo "cwebp: OK" || echo "cwebp: Missing"
84+
@avifenc --version > /dev/null 2>&1 && echo "avifenc: OK" || echo "avifenc: Missing"
85+
@magick -version > /dev/null 2>&1 && echo "magick: OK" || echo "magick: Missing"
86+
6487

6588
clean:
6689
$(RM) -rf package_build/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ cd scripts
2323
```
2424
or Release: https://github.com/bensuperpc/scripts/releases
2525

26+
###### Check dependency:
27+
28+
```sh
29+
make check-dep
30+
```
31+
32+
###### And install:
33+
2634
```sh
2735
make install
2836
```
37+
2938
#### Uninstall
3039
```sh
3140
make uninstall

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ echo "copy done"
5454

5555
echo "Install ben's scripts..."
5656
echo "create symlink..."
57-
find /usr/bin/ben_script -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" ! -path "*/cryptr/*" ! -path "*/others-dist/*" ! -path "*/bash-scripts/*" | xargs -P$(nproc) -I{} sudo ln -s {} /usr/bin || true
58-
find /usr/bin/ben_script -type f -name "*.py" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" ! -path "*/cryptr/*" ! -path "*/others-dist/*" ! -path "*/bash-scripts/*" | xargs -P$(nproc) -I{} sudo ln -s {} /usr/bin || true
57+
find /usr/bin/ben_script -type f -name "*.sh" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" ! -path "*/cryptr/*" ! -path "*/others-dist/*" ! -path "*/bash-scripts/*" ! -path "*/fff/*" | xargs -P$(nproc) -I{} sudo ln -s {} /usr/bin || true
58+
find /usr/bin/ben_script -type f -name "*.py" ! -path "*./git/*" ! -path "*/install.sh" ! -path "*/uninstall.sh" ! -path "*/Bash-Snippet/*" ! -path "*/git-scripts/*" ! -path "*/git-extras/*" ! -path "*/git-extra-commands/*" ! -path "*/cryptr/*" ! -path "*/others-dist/*" ! -path "*/bash-scripts/*" ! -path "*/fff/*" | xargs -P$(nproc) -I{} sudo ln -s {} /usr/bin || true
5959
echo "create symlink done"
6060
echo "Install ben's scripts done"
6161

0 commit comments

Comments
 (0)