-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-executable_files.sh
More file actions
executable file
·62 lines (57 loc) · 1.61 KB
/
git-executable_files.sh
File metadata and controls
executable file
·62 lines (57 loc) · 1.61 KB
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
62
#! /bin/sh
### Loader fuer base-libraries
homedir=~
base_configuration_directory=~/etc/base_configuration
if [ -d ${base_configuration_directory} ]
then
. ${base_configuration_directory}/base_presets.sh
. ${base_configuration_directory}/git_presets.sh
else
. ./base_functions.sh
. ./presets.sh
fi
for library_file in git_library.sh visuals_library.sh
do
. ${default_functions_dir}/${library_file}
done
###
filetypes=".sh .bash .py"
search_path=""
for directory in ${git_repository_base_directories}
do
if [ -d ${homedir}/${directory} ]
then
search_path="${search_path} ${homedir}/${directory}/"
fi
done
if [ "${search_path}" != "" ]
then
for directory in $(find ${search_path} -type d -name .git | sort)
do
parse_git_repository ${directory} | grep "^git_repository:" | cut -f 2 -d ":" | while read repository_directory
do
for filetype in $(echo ${filetypes} | sed "s/\.//g" )
do
find ${repository_directory} -type f -name "*.${filetype}" | while read script_file
do
echo "${script_file}"
script_first_line=$(head -1 ${script_file})
script_chmod_state=$(stat -c %a ${script_file})
if echo "${script_first_line}" | grep -q "^#! *"
then
script_interpreter=$(echo "${script_first_line}" | sed "s/^#! *//")
echo "Script-File ${script_interpreter} ${script_chmod_state}"
if [ -f "${script_interpreter}" -a $(echo "${script_chmod_state}" | cut -c 1) -ne 7 ]
then
echo "Aendere File:"
echo "git update-index --chmod=+x ${script_file}"
echo "chmod +x ${script_file}"
fi
else
echo "Something else"
fi
done
done
done
done
fi