@@ -12,12 +12,13 @@ import UserNotifications
1212struct LauncherView : View {
1313
1414 @State var repoView = false
15+ @AppStorage ( " devMode " ) var devMode = true
1516 var shell = Shell ( )
1617 @Environment ( \. managedObjectContext) var moc
1718 @FetchRequest ( sortDescriptors: [ SortDescriptor ( \. title) ] ) var launcherRepos : FetchedResults < LauncherRepos >
1819 @State var existingRepo = URL ( string: " " )
1920 @State var repoTitle = " "
20- @State var currentVersion = " v1.1.8 \n "
21+ @State var currentVersion = " v1.1.9 \n "
2122 @State var updateAlert = false
2223 @State var latestVersion = " "
2324 @State var repoArgs = " "
@@ -143,6 +144,47 @@ struct LauncherView: View {
143144
144145 Spacer ( )
145146
147+ Menu {
148+ Button ( action: {
149+
150+ for i in 0 ... launcherRepos. count - 1 {
151+ launcherRepos [ i] . isEditing = false
152+ }
153+
154+ print ( try ? launcherShell ( " \( LauncherRepo . path ?? " its broken " ) \( LauncherRepo . args ?? " " ) " ) )
155+
156+ beginLogging = true
157+
158+ print ( LauncherRepo . path ?? " " )
159+ } ) {
160+ Text ( " Log " )
161+
162+ Image ( systemName: " arrow.right.circle.fill " )
163+ }
164+
165+ Button ( action: {
166+
167+ for i in 0 ... launcherRepos. count - 1 {
168+ launcherRepos [ i] . isEditing = false
169+ }
170+
171+ let launcherRepo = launcherRepos [ i]
172+
173+ moc. delete ( launcherRepo)
174+
175+ do {
176+ try moc. save ( )
177+ }
178+ catch {
179+ print ( " Error: its broken: \( error) " )
180+ }
181+ } ) {
182+ Text ( " Remove Repo " )
183+ }
184+ } label: {
185+ Text ( " ... " )
186+ } . frame ( width: 40 )
187+
146188 Button ( action: {
147189
148190 for iEdit in 0 ... launcherRepos. count - 1 {
@@ -196,43 +238,6 @@ struct LauncherView: View {
196238 }
197239 }
198240
199- Button ( action: {
200-
201- for i in 0 ... launcherRepos. count - 1 {
202- launcherRepos [ i] . isEditing = false
203- }
204-
205- let launcherRepo = launcherRepos [ i]
206-
207- moc. delete ( launcherRepo)
208-
209- do {
210- try moc. save ( )
211- }
212- catch {
213- print ( " Error: its broken: \( error) " )
214- }
215- } ) {
216- Image ( systemName: " trash " )
217- }
218-
219- Button ( action: {
220-
221- for i in 0 ... launcherRepos. count - 1 {
222- launcherRepos [ i] . isEditing = false
223- }
224-
225- print ( try ? launcherShell ( " \( LauncherRepo . path ?? " its broken " ) \( LauncherRepo . args ?? " " ) " ) )
226-
227- beginLogging = true
228-
229- print ( LauncherRepo . path ?? " " )
230- } ) {
231- Text ( " Log " )
232-
233- Image ( systemName: " arrow.right.circle.fill " )
234- }
235-
236241 Button ( action: {
237242
238243 for i in 0 ... launcherRepos. count - 1 {
@@ -352,7 +357,10 @@ struct LauncherView: View {
352357
353358 print ( " its intel's turn nerd what an idiot man " )
354359
355- print ( try ? shell. intelShell ( " /usr/local/bin/brew install gcc gcc@9 sdl2 pkg-config glew glfw3 libusb audiofile coreutils " ) )
360+ do {
361+ try shell. intelShell ( " /usr/local/bin/brew install gcc gcc@9 sdl2 pkg-config glew glfw3 libusb audiofile coreutils " )
362+ }
363+ catch { }
356364
357365 let content = UNMutableNotificationContent ( )
358366 content. title = " Finished installing dependencies "
0 commit comments