T1.1: Create src/domain; move Job/RunRecord/Config/JobsFile/StartInTrayArgument
Extracts the five domain types out of src/core/model.go into a new src/domain package (job.go, record.go, config.go). The unexported nextDue field is promoted to NextDue so it is accessible from core. All references across src/core, src/gui, and cmd/gosentry are updated to use domain.TypeName. src/core/model.go is reduced to a bare package declaration. Windows and Linux cross-compilation both pass; all tests remain green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gitea.mixdep.ru/mix/gosentry/src/domain"
|
||||
)
|
||||
|
||||
const autostartName = "GoSentry"
|
||||
@@ -69,7 +71,7 @@ func AutostartStatus(expectedEnabled bool, executablePath string) (bool, string)
|
||||
if !sameWindowsPath(actual, executablePath) {
|
||||
return false, "Autostart shortcut points to another executable"
|
||||
}
|
||||
if strings.TrimSpace(arguments) != StartInTrayArgument {
|
||||
if strings.TrimSpace(arguments) != domain.StartInTrayArgument {
|
||||
return false, "Autostart shortcut does not start in tray"
|
||||
}
|
||||
return true, "Autostart is configured"
|
||||
@@ -101,7 +103,7 @@ func createStartupShortcut(shortcutPath string, executablePath string, iconPath
|
||||
command.Env = append(os.Environ(),
|
||||
"GOSENTRY_SHORTCUT_PATH="+shortcutPath,
|
||||
"GOSENTRY_TARGET_PATH="+executablePath,
|
||||
"GOSENTRY_ARGUMENTS="+StartInTrayArgument,
|
||||
"GOSENTRY_ARGUMENTS="+domain.StartInTrayArgument,
|
||||
"GOSENTRY_WORKING_DIRECTORY="+workingDirectory,
|
||||
"GOSENTRY_ICON_PATH="+iconPath,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user