@@ -161,7 +161,7 @@ struct Outset: ParsableCommand {
161
161
// perform log file rotation
162
162
performLogRotation ( logFolderPath: logDirectory, logFileBaseName: logFileName, maxLogFiles: logFileMaxCount)
163
163
164
- writeLog ( " Processing scheduled runs for boot " , logLevel: . debug )
164
+ writeLog ( " Processing scheduled runs for boot " , logLevel: . info )
165
165
ensureWorkingFolders ( )
166
166
167
167
writeOutsetPreferences ( prefs: prefs)
@@ -190,15 +190,15 @@ struct Outset: ParsableCommand {
190
190
}
191
191
192
192
if loginWindow {
193
- writeLog ( " Processing scheduled runs for login window " , logLevel: . debug )
193
+ writeLog ( " Processing scheduled runs for login window " , logLevel: . info )
194
194
195
195
if !folderContents( path: loginWindowDir) . isEmpty {
196
196
processItems ( loginWindowDir)
197
197
}
198
198
}
199
199
200
200
if login {
201
- writeLog ( " Processing scheduled runs for login " , logLevel: . debug )
201
+ writeLog ( " Processing scheduled runs for login " , logLevel: . info )
202
202
if !prefs. ignoredUsers. contains ( consoleUser) {
203
203
if !folderContents( path: loginOnceDir) . isEmpty {
204
204
processItems ( loginOnceDir, once: true , override: prefs. overrideLoginOnce)
@@ -207,14 +207,14 @@ struct Outset: ParsableCommand {
207
207
processItems ( loginEveryDir)
208
208
}
209
209
if !folderContents( path: loginOncePrivilegedDir) . isEmpty || !folderContents( path: loginEveryPrivilegedDir) . isEmpty {
210
- FileManager . default . createFile ( atPath : loginPrivilegedTrigger, contents : nil )
210
+ createTrigger ( loginPrivilegedTrigger)
211
211
}
212
212
}
213
213
214
214
}
215
215
216
216
if loginPrivileged {
217
- writeLog ( " Processing scheduled runs for privileged login " , logLevel: . debug )
217
+ writeLog ( " Processing scheduled runs for privileged login " , logLevel: . info )
218
218
if checkFileExists ( path: loginPrivilegedTrigger) {
219
219
pathCleanup ( pathname: loginPrivilegedTrigger)
220
220
}
@@ -231,29 +231,24 @@ struct Outset: ParsableCommand {
231
231
}
232
232
233
233
if onDemand {
234
- writeLog ( " Processing on-demand " , logLevel: . debug )
234
+ writeLog ( " Processing on-demand " , logLevel: . info )
235
235
if !folderContents( path: onDemandDir) . isEmpty {
236
236
if ![ " root " , " loginwindow " ] . contains ( consoleUser) {
237
237
let currentUser = NSUserName ( )
238
238
if consoleUser == currentUser {
239
239
processItems ( onDemandDir)
240
+ createTrigger ( cleanupTrigger)
240
241
} else {
241
242
writeLog ( " User \( currentUser) is not the current console user. Skipping on-demand run. " )
242
243
}
243
244
} else {
244
245
writeLog ( " No current user session. Skipping on-demand run. " )
245
246
}
246
- FileManager . default. createFile ( atPath: cleanupTrigger, contents: nil )
247
- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.5 ) {
248
- if checkFileExists ( path: cleanupTrigger) {
249
- pathCleanup ( pathname: cleanupTrigger)
250
- }
251
- }
252
247
}
253
248
}
254
249
255
250
if loginEvery {
256
- writeLog ( " Processing scripts in login-every " , logLevel: . debug )
251
+ writeLog ( " Processing scripts in login-every " , logLevel: . info )
257
252
if !prefs. ignoredUsers. contains ( consoleUser) {
258
253
if !folderContents( path: loginEveryDir) . isEmpty {
259
254
processItems ( loginEveryDir)
@@ -262,7 +257,7 @@ struct Outset: ParsableCommand {
262
257
}
263
258
264
259
if loginOnce {
265
- writeLog ( " Processing scripts in login-once " , logLevel: . debug )
260
+ writeLog ( " Processing scripts in login-once " , logLevel: . info )
266
261
if !prefs. ignoredUsers. contains ( consoleUser) {
267
262
if !folderContents( path: loginOnceDir) . isEmpty {
268
263
processItems ( loginOnceDir, once: true , override: prefs. overrideLoginOnce)
@@ -273,7 +268,7 @@ struct Outset: ParsableCommand {
273
268
}
274
269
275
270
if cleanup {
276
- writeLog ( " Cleaning up on-demand directory. " , logLevel: . debug )
271
+ writeLog ( " Cleaning up on-demand directory. " , logLevel: . info )
277
272
if checkFileExists ( path: onDemandTrigger) { pathCleanup ( pathname: onDemandTrigger) }
278
273
if checkFileExists ( path: cleanupTrigger) { pathCleanup ( pathname: cleanupTrigger) }
279
274
if !folderContents( path: onDemandDir) . isEmpty { pathCleanup ( pathname: onDemandDir) }
@@ -309,7 +304,7 @@ struct Outset: ParsableCommand {
309
304
ensureRoot ( " add scripts to override list " )
310
305
311
306
for var override in addOverride {
312
- if !override. contains ( loginOnceDir) {
307
+ if !override. contains ( loginOnceDir) && !override . contains ( loginOncePrivilegedDir ) {
313
308
override = " \( loginOnceDir) / \( override) "
314
309
}
315
310
writeLog ( " Adding \( override) to override list " , logLevel: . debug)
0 commit comments