diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 10:56:19 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 10:56:19 +0200 |
| commit | 48d1781fed3f9ea5cfd2b270bd92fd2826605636 (patch) | |
| tree | 8abddf0ae7aaab97426cad1f65038560c8b85b9f /gui/internal/model/newdir.go | |
| parent | a2cb20851499e9c00bd3bf642680a9ce3148cae8 (diff) | |
| download | krino-48d1781fed3f9ea5cfd2b270bd92fd2826605636.tar.gz krino-48d1781fed3f9ea5cfd2b270bd92fd2826605636.zip | |
gui: conditions as a nested tree, and a way to add a directory
Diffstat (limited to 'gui/internal/model/newdir.go')
| -rw-r--r-- | gui/internal/model/newdir.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gui/internal/model/newdir.go b/gui/internal/model/newdir.go new file mode 100644 index 0000000..d0df6db --- /dev/null +++ b/gui/internal/model/newdir.go @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package model + +import ( + "krino/internal/config" + "krino/internal/engine" +) + +// AddDirectory writes dirs/NAME.conf from the template with path filled in +// and adds NAME to krino.conf's include - exactly what `krino new NAME +// PATH` does, through the same code, so a directory made in the window is +// indistinguishable from one made on the command line (his report that the +// window had no way to add one, 2026-09-17). +// +// It returns the new file's path. The caller reloads the engine: until it +// does, the window knows nothing of the new directory. +func AddDirectory(e *engine.Engine, name, path string) (string, error) { + return config.NewDir(e.MainFile, name, path) +} |
