Browse code

In "Apollia_Files/Java Policies/Choose Default Version/AppRun", mostly just renamed various vars. Changed $App_Name to $Thing_to_Choose (which is now "Java policy used by Apollia's VUE launchers" rather than an app name), and changed any instance of anything like "app version" to just "version".

Apollia authored on01/27/2021 01:36:17
Showing1 changed files
... ...
@@ -8,10 +8,16 @@
8 8
 #
9 9
 # 06:51:47 09/19/2018.  This version outputs a text file instead of a symlink,
10 10
 # to make it work even in non-GNU/Linux disks which can't handle symlinks.
11
+#
12
+#
13
+# 20:02:27 01/26/2021.  Slightly modified for VUE repo:
14
+#
15
+# https://apollia.org/gitlist/VUE---Modified-by-Apollia.git
16
+
11 17
 
12 18
 
13
-readonly App_Name="APSK Runner"
14
-	readonly Script_Title="Choose Default Version - $App_Name Edition"
19
+readonly Thing_to_Choose="Java policy used by Apollia's VUE launchers"
20
+	readonly Script_Title="Choose default version - $Thing_to_Choose"
15 21
 
16 22
 
17 23
 readonly Original_Working_Dir=$(pwd)
... ...
@@ -20,8 +26,8 @@ readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
20 26
 	readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script")
21 27
 
22 28
 		readonly Foldername____This_Script=$(basename "$Follpath____This_Script")
23
-		readonly Follpath____App_Versions_Home=$(realpath "$Follpath____This_Script/..")
24
-			readonly Note_Fillepath____Default_Version="$Follpath____App_Versions_Home/Default-Version"
29
+		readonly Follpath____Versions_Home=$(realpath "$Follpath____This_Script/..")
30
+			readonly Note_Fillepath____Default_Version="$Follpath____Versions_Home/Default-Version"
25 31
 
26 32
 
27 33
 echo
... ...
@@ -33,15 +39,15 @@ echo "	$Script_Title"
33 39
 echo "	--------------------------------------------"
34 40
 
35 41
 
36
-readonly GUI_Title="Choose Default Version of $App_Name"
37
-readonly GUI_Message="Which version of $App_Name should be the default?"
42
+readonly GUI_Title="Choose default version of $Thing_to_Choose"
43
+readonly GUI_Message="Which version of the $Thing_to_Choose should be the default?"
38 44
 
39 45
 
40 46
 readonly EOL=$'\n'
41 47
 
42
-echo "App_Name: $App_Name"
48
+echo "Thing_to_Choose: $Thing_to_Choose"
43 49
 
44
-readonly Arg____App_Version="$1"
50
+readonly Arg____Version="$1"
45 51
 
46 52
 
47 53
 
... ...
@@ -58,7 +64,7 @@ Possibly_Replace_Note____Default_Version()
58 64
 		retval="$folname"
59 65
 	
60 66
 	
61
-	cd "$Follpath____App_Versions_Home"
67
+	cd "$Follpath____Versions_Home"
62 68
 	
63 69
 	if [ -d "$folname" ]
64 70
 	then
... ...
@@ -85,21 +91,21 @@ readonly -f Possibly_Replace_Note____Default_Version
85 91
 
86 92
 ############
87 93
 # Function
88
-Possibly_Switch_to_App_Version()
94
+Possibly_Switch_to_Version()
89 95
 {
90
-	local app_version="$1"
96
+	local version="$1"
91 97
 	
92 98
 	if [ -f "$Note_Fillepath____Default_Version" ]
93 99
 	then
94 100
 		Folname____Current_Default_Version=$(cat "$Note_Fillepath____Default_Version")
95 101
 		
96 102
 		
97
-		if [ "$app_version" = "$Folname____Current_Default_Version" ]
103
+		if [ "$version" = "$Folname____Current_Default_Version" ]
98 104
 		then
99 105
 			echo
100 106
 			echo "Aborting - nothing to do, since the chosen default version was the same as the current default version:
101 107
 		
102
-	$app_version"
108
+	$version"
103 109
 			
104 110
 			
105 111
 			#!!!!
... ...
@@ -108,27 +114,27 @@ Possibly_Switch_to_App_Version()
108 114
 	fi
109 115
 	
110 116
 	
111
-	Possibly_Replace_Note____Default_Version "$app_version"
117
+	Possibly_Replace_Note____Default_Version "$version"
112 118
 		result_code="$?"
113 119
 	
114 120
 	if [ "$result_code" = 0 ]
115 121
 	then
116 122
 		echo
117 123
 		echo
118
-		echo "$App_Name default version is now: $retval"
124
+		echo "$Thing_to_Choose default version is now: $retval"
119 125
 		
120 126
 		
121 127
 		#!!!!
122 128
 		exit 0
123 129
 	else
124
-		echo "Wasn't able to change $App_Name default version to $retval!"
130
+		echo "Wasn't able to change $Thing_to_Choose default version to $retval!"
125 131
 	fi
126 132
 	
127 133
 	
128 134
 	#!!!!
129 135
 	exit 1
130 136
 }
131
-readonly -f Possibly_Switch_to_App_Version
137
+readonly -f Possibly_Switch_to_Version
132 138
 
133 139
 # End of
134 140
 # Function
... ...
@@ -136,12 +142,12 @@ readonly -f Possibly_Switch_to_App_Version
136 142
 
137 143
 
138 144
 
139
-if [ ! -z "$Arg____App_Version" ]
145
+if [ ! -z "$Arg____Version" ]
140 146
 then
141 147
 
142 148
 	
143 149
 	#!!!!
144
-	Possibly_Switch_to_App_Version "$Arg____App_Version"
150
+	Possibly_Switch_to_Version "$Arg____Version"
145 151
 	
146 152
 	
147 153
 fi
... ...
@@ -152,7 +158,7 @@ fi
152 158
 # Function
153 159
 Find_Versions()
154 160
 {
155
-	find "$Follpath____App_Versions_Home" -mindepth 1 -maxdepth 1  -type d -not -name "*$EOL*" -not -name "$Foldername____This_Script" -printf "%f\n" | sort -h
161
+	find "$Follpath____Versions_Home" -mindepth 1 -maxdepth 1  -type d -not -name "*$EOL*" -not -name "$Foldername____This_Script" -printf "%f\n" | sort -h
156 162
 }
157 163
 readonly -f Find_Versions
158 164
 
... ...
@@ -180,7 +186,7 @@ Build_GUI_Window()
180 186
 		  <variable>VERSION</variable>'
181 187
 
182 188
 	GUI_BEING_BUILT+="<input>Find_Versions</input>"
183
-	GUI_BEING_BUILT+='<action>Possibly_Switch_to_App_Version "$VERSION"</action>'
189
+	GUI_BEING_BUILT+='<action>Possibly_Switch_to_Version "$VERSION"</action>'
184 190
 	GUI_BEING_BUILT+='<action>EXIT:ok</action>'
185 191
 	GUI_BEING_BUILT+='</list>'
186 192
 	
... ...
@@ -225,10 +231,10 @@ echo "$GUI_Window"
225 231
 
226 232
 
227 233
 List____Vars_to_Export=(
228
-		"Follpath____App_Versions_Home"
234
+		"Follpath____Versions_Home"
229 235
 		"EOL"
230 236
 		"Foldername____This_Script"
231
-		"App_Name"
237
+		"Thing_to_Choose"
232 238
 		"Note_Fillepath____Default_Version"
233 239
 )
234 240
 
... ...
@@ -240,7 +246,7 @@ done
240 246
 
241 247
 export -f Find_Versions
242 248
 export -f Possibly_Replace_Note____Default_Version
243
-export -f Possibly_Switch_to_App_Version
249
+export -f Possibly_Switch_to_Version
244 250
 
245 251
 export GUI_Window
246 252