updating a compose file over the API now saves it, not just deploys it
This commit is contained in:
2 files changed
+40
-17
No files matched your search
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* The ONE formula for a stack's folder under a base dir on a host: `<base>/<stack>`.
|
||||
* Deploy staging (write) and backup (read) share it so they can't diverge (#1383 / #1240).
|
||||
* Pure + dependency-free, so both sides can import it.
|
||||
*/
|
||||
|
||||
/** Trim + drop trailing slashes: `/data/stacks/` -> `/data/stacks`. */
|
||||
export function normalizeBaseDir(base: string): string {
|
||||
return base.trim().replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
/** `<normalized base>/<stackName>`. Name is used verbatim - do NOT slugify (both sides use it raw). */
|
||||
export function stackDirIn(base: string, stackName: string): string {
|
||||
return `${normalizeBaseDir(base)}/${stackName}`;
|
||||
}
|
||||
Reference in new issue
Block a user