@@ -161,7 +161,7 @@ struct Outset: ParsableCommand {
161161 // perform log file rotation
162162 performLogRotation ( logFolderPath: logDirectory, logFileBaseName: logFileName, maxLogFiles: logFileMaxCount)
163163
164- writeLog ( " Processing scheduled runs for boot " , logLevel: . debug )
164+ writeLog ( " Processing scheduled runs for boot " , logLevel: . info )
165165 ensureWorkingFolders ( )
166166
167167 writeOutsetPreferences ( prefs: prefs)
@@ -190,15 +190,15 @@ struct Outset: ParsableCommand {
190190 }
191191
192192 if loginWindow {
193- writeLog ( " Processing scheduled runs for login window " , logLevel: . debug )
193+ writeLog ( " Processing scheduled runs for login window " , logLevel: . info )
194194
195195 if !folderContents( path: loginWindowDir) . isEmpty {
196196 processItems ( loginWindowDir)
197197 }
198198 }
199199
200200 if login {
201- writeLog ( " Processing scheduled runs for login " , logLevel: . debug )
201+ writeLog ( " Processing scheduled runs for login " , logLevel: . info )
202202 if !prefs. ignoredUsers. contains ( consoleUser) {
203203 if !folderContents( path: loginOnceDir) . isEmpty {
204204 processItems ( loginOnceDir, once: true , override: prefs. overrideLoginOnce)
@@ -207,14 +207,14 @@ struct Outset: ParsableCommand {
207207 processItems ( loginEveryDir)
208208 }
209209 if !folderContents( path: loginOncePrivilegedDir) . isEmpty || !folderContents( path: loginEveryPrivilegedDir) . isEmpty {
210- FileManager . default . createFile ( atPath : loginPrivilegedTrigger, contents : nil )
210+ createTrigger ( loginPrivilegedTrigger)
211211 }
212212 }
213213
214214 }
215215
216216 if loginPrivileged {
217- writeLog ( " Processing scheduled runs for privileged login " , logLevel: . debug )
217+ writeLog ( " Processing scheduled runs for privileged login " , logLevel: . info )
218218 if checkFileExists ( path: loginPrivilegedTrigger) {
219219 pathCleanup ( pathname: loginPrivilegedTrigger)
220220 }
@@ -231,29 +231,24 @@ struct Outset: ParsableCommand {
231231 }
232232
233233 if onDemand {
234- writeLog ( " Processing on-demand " , logLevel: . debug )
234+ writeLog ( " Processing on-demand " , logLevel: . info )
235235 if !folderContents( path: onDemandDir) . isEmpty {
236236 if ![ " root " , " loginwindow " ] . contains ( consoleUser) {
237237 let currentUser = NSUserName ( )
238238 if consoleUser == currentUser {
239239 processItems ( onDemandDir)
240+ createTrigger ( cleanupTrigger)
240241 } else {
241242 writeLog ( " User \( currentUser) is not the current console user. Skipping on-demand run. " )
242243 }
243244 } else {
244245 writeLog ( " No current user session. Skipping on-demand run. " )
245246 }
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- }
252247 }
253248 }
254249
255250 if loginEvery {
256- writeLog ( " Processing scripts in login-every " , logLevel: . debug )
251+ writeLog ( " Processing scripts in login-every " , logLevel: . info )
257252 if !prefs. ignoredUsers. contains ( consoleUser) {
258253 if !folderContents( path: loginEveryDir) . isEmpty {
259254 processItems ( loginEveryDir)
@@ -262,7 +257,7 @@ struct Outset: ParsableCommand {
262257 }
263258
264259 if loginOnce {
265- writeLog ( " Processing scripts in login-once " , logLevel: . debug )
260+ writeLog ( " Processing scripts in login-once " , logLevel: . info )
266261 if !prefs. ignoredUsers. contains ( consoleUser) {
267262 if !folderContents( path: loginOnceDir) . isEmpty {
268263 processItems ( loginOnceDir, once: true , override: prefs. overrideLoginOnce)
@@ -273,7 +268,7 @@ struct Outset: ParsableCommand {
273268 }
274269
275270 if cleanup {
276- writeLog ( " Cleaning up on-demand directory. " , logLevel: . debug )
271+ writeLog ( " Cleaning up on-demand directory. " , logLevel: . info )
277272 if checkFileExists ( path: onDemandTrigger) { pathCleanup ( pathname: onDemandTrigger) }
278273 if checkFileExists ( path: cleanupTrigger) { pathCleanup ( pathname: cleanupTrigger) }
279274 if !folderContents( path: onDemandDir) . isEmpty { pathCleanup ( pathname: onDemandDir) }
@@ -309,7 +304,7 @@ struct Outset: ParsableCommand {
309304 ensureRoot ( " add scripts to override list " )
310305
311306 for var override in addOverride {
312- if !override. contains ( loginOnceDir) {
307+ if !override. contains ( loginOnceDir) && !override . contains ( loginOncePrivilegedDir ) {
313308 override = " \( loginOnceDir) / \( override) "
314309 }
315310 writeLog ( " Adding \( override) to override list " , logLevel: . debug)
0 commit comments