social_stream-presence 0.8.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,112 +0,0 @@
1
- #!/bin/bash
2
- #Script header edition
3
- #@author Aldo
4
-
5
- #Constants
6
- installer_file_path=$(readlink -f $0)
7
- installer_folder_path=`dirname "$installer_file_path"`
8
-
9
-
10
- #Functions
11
-
12
-
13
- msg () {
14
- echo "#################################"
15
- echo $1
16
- }
17
-
18
-
19
- #Main Program
20
-
21
- msg "Starting set scripts header"
22
-
23
- echo "Installer path:" $installer_file_path
24
-
25
-
26
- #Look for params
27
-
28
- msg "Detecting ruby enviroment"
29
-
30
- if [ $1 ]
31
- then {
32
- echo "Ruby enviromet specified by param"
33
- ruby_env=$1
34
- } else {
35
- ruby_env=`which ruby`
36
- }
37
- fi
38
-
39
- echo "Ruby enviroment:" $ruby_env
40
-
41
-
42
- msg "Writing scripts header"
43
- echo ""
44
- for file in `ls $installer_folder_path/` ; do
45
-
46
-
47
- if [ ! -f $installer_folder_path/$file ];
48
- then
49
- continue
50
- fi
51
-
52
- if [[ $file =~ .sh$ ]]
53
- then
54
- continue
55
- fi
56
-
57
- if [ $installer_folder_path/$file == $installer_file_path ];
58
- then
59
- continue
60
- fi
61
-
62
-
63
- printf $file"\n"
64
-
65
- #Create temporal file
66
- temporal_path=$installer_folder_path/$file"_temp"
67
-
68
- if [ -f $temporal_path ];
69
- then
70
- echo "File $temporal_path exists."
71
- rm $temporal_path
72
- fi
73
-
74
- touch $temporal_path
75
-
76
- #Read file
77
- file_path=$installer_folder_path/$file
78
-
79
- SAVEIFS=$IFS
80
- IFS=$(echo -en "\n\b")
81
-
82
- while read line
83
- do
84
- #Look for Pattern !/usr/bin/env ruby
85
- if [[ $line =~ ^#!/usr/bin/env ]]
86
- then
87
- scriptheader="#!/usr/bin/env"
88
- line="${scriptheader} ${ruby_env}"
89
- fi
90
- echo $line >> $temporal_path
91
- done < $file_path
92
-
93
- IFS=$SAVEIFS
94
-
95
- #Replace original file
96
- cp $temporal_path $file_path
97
-
98
- #Remove temporal file
99
- rm $temporal_path
100
-
101
- done
102
-
103
-
104
- msg "Complete"
105
- exit 0
106
-
107
-
108
-
109
-
110
-
111
-
112
-