setup-kapelu 3.2.6 → 3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/install.sh +33 -9
  2. package/package.json +1 -1
package/install.sh CHANGED
@@ -52,6 +52,16 @@ check_git(){
52
52
  fi
53
53
  }
54
54
 
55
+ permits(){
56
+ while IFS= read -r -d '' file
57
+ do
58
+ if head -n1 "$file" | grep -q "^#!"
59
+ then
60
+ chmod +x "$file"
61
+ fi
62
+ done < <(find . -type f -print0)
63
+ }
64
+
55
65
  backup_bashrc(){
56
66
 
57
67
  if [ -f "$HOME_DIR/.bashrc" ]; then
@@ -69,11 +79,12 @@ clone_repo(){
69
79
 
70
80
  copy_scripts(){
71
81
 
72
- mkdir -p "$HOME_DIR/script"
82
+ mkdir -p "$HOME_DIR/script"
73
83
 
74
- cp "$TMP_DIR/script/"* "$HOME_DIR/script/"
84
+ cp -r "$TMP_DIR/script/." "$HOME_DIR/script/"
85
+
86
+ find "$HOME_DIR/script" -type f -name "*.sh" -exec chmod +x {} \;
75
87
 
76
- chmod +x "$HOME_DIR/script/"*
77
88
  }
78
89
 
79
90
  copy_config(){
@@ -135,13 +146,26 @@ run_setup(){
135
146
  printf "${green}📦 ¿Desea ejecutar setup.sh? (s/n): ${reset}"
136
147
  read RESP
137
148
 
149
+ if [ "$RESP" = "s" ]; then
150
+
151
+ FILE="$HOME_DIR/script/setup.sh"
152
+
153
+ if [ ! -f "$FILE" ]; then
154
+ echo "❌ Error: setup.sh no encontrado en $HOME_DIR/script/"
155
+ return 1
156
+ fi
157
+
158
+ if [ ! -x "$FILE" ]; then
159
+ chmod +x "$FILE"
160
+ fi
161
+
162
+ "$FILE"
163
+
164
+ else
165
+ system_update
166
+ system_cleanup
167
+ fi
138
168
 
139
- if [ "$RESP" = "s" ]; then
140
- bash "$HOME_DIR/script/setup.sh"
141
- else
142
- system_update
143
- system_cleanup
144
- fi
145
169
  }
146
170
 
147
171
  main(){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "setup-kapelu",
3
- "version": "3.2.6",
3
+ "version": "3.2.8",
4
4
  "description": "Script post-install de Ubuntu",
5
5
  "type": "commonjs",
6
6
  "bin": {