forked from nyxssmith/spellcheck-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·36 lines (30 loc) · 833 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·36 lines (30 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
find_file(){
# Find a desired file and copy it to pwd
DEAFULT=.github/default/$1
CUSTOM=.github/custom/$1
if test -f "$CUSTOM"; then
# Try the custom file
cp $CUSTOM .
else
if test -f "$DEAFULT"; then
# Try the default file
cp $DEAFULT .
else
file=$(find . | grep -w "$1"| head -n 1)
touch $file
found_file=$?
if [[ "$found_file" -eq 0 ]]; then
# Try find file at other location
cp $file .
else
# Use the default one with the package
echo "$1 not found, using default\n"
cp /$1 .
fi
fi
fi
}
find_file "wordlist.txt"
find_file "spellcheck.yaml"
pyspelling -c spellcheck.yaml