mirror of
https://github.com/hansjone/dsh-ops-cron.git
synced 2026-10-11 10:33:29 +08:00
Keep shared external cron cwd (e.g. D:\code\gpt) instead of silent clamp.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
7a2a673ac2
commit
43facd608a
5 changed files with 111 additions and 14 deletions
10
lib/store.js
10
lib/store.js
|
|
@ -22,6 +22,12 @@ export const DEFAULT_SETTINGS = {
|
|||
historyLimit: 200,
|
||||
overlapPolicy: 'skip',
|
||||
misfirePolicy: 'skip',
|
||||
/**
|
||||
* When true (default), an explicit job cwd that lies OUTSIDE the multi-tenant
|
||||
* provision forest (workspaceRoot/<empNo>) is kept — e.g. D:\\code\\gpt.
|
||||
* Paths under the forest but not the owner's tree are still clamped.
|
||||
*/
|
||||
allowExternalCwd: true,
|
||||
}
|
||||
|
||||
export function emptyState() {
|
||||
|
|
@ -37,6 +43,9 @@ export function emptyState() {
|
|||
export function normalizeSettings(input = {}, fallback = DEFAULT_SETTINGS) {
|
||||
const src = input && typeof input === 'object' ? input : {}
|
||||
const historyLimit = Number(src.historyLimit)
|
||||
const allowExternalCwd = src.allowExternalCwd !== undefined
|
||||
? src.allowExternalCwd !== false
|
||||
: fallback.allowExternalCwd !== false
|
||||
return {
|
||||
enabled: src.enabled !== false,
|
||||
timezone: typeof src.timezone === 'string' && src.timezone.trim()
|
||||
|
|
@ -47,6 +56,7 @@ export function normalizeSettings(input = {}, fallback = DEFAULT_SETTINGS) {
|
|||
: fallback.historyLimit,
|
||||
overlapPolicy: src.overlapPolicy === 'skip' ? 'skip' : fallback.overlapPolicy,
|
||||
misfirePolicy: src.misfirePolicy === 'skip' ? 'skip' : fallback.misfirePolicy,
|
||||
allowExternalCwd,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue