-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
misspell-fixer
executable file
·61 lines (51 loc) · 1.25 KB
/
misspell-fixer
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
export source_directory="${BASH_SOURCE[0]%misspell-fixer}"
if [[ "$source_directory" == "" ]]
then
source_directory='./'
fi
if [ ! -f "${source_directory}/rules/safe.0.sed" ]
then
source_directory="/usr/share/misspell-fixer/"
fi
export rules_directory="${source_directory}rules"
# shellcheck source=lib/initialisation_functions.sh shell=bash
source "${source_directory}/lib/initialisation_functions.sh"
# shellcheck source=lib/main_functions.sh shell=bash
source "${source_directory}/lib/main_functions.sh"
initialise_variables
process_command_arguments "$@"
retval=$?
if [[ $retval == 0 ]]
then
handle_parameter_conflicts
retval=$?
fi
if [[ $retval == 0 ]]
then
handle_whitelist_configfile
retval=$?
fi
if [[ $retval == 0 ]]
then
if [[ $opt_debug = 1 ]]
then
set -x
fi
check_grep_version
check_sed_arguments
prepare_rules_for_prefiltering
iterate_through_targets list_files_from_find 0 '' /dev/null
retval=$?
rm $tmpfile.prepared.grep.patterns $tmpfile.prepared.grep.patterns.word_limited $tmpfile.prepared.sed.all_rules $tmpfile.git.ignore
if [[ $opt_debug = 1 ]]
then
set +x
fi
fi
if [[ "$SHUNIT_VERSION" = "" ]]
then
exit $retval
else
return $retval
fi