openmates 0.15.0-alpha.113 → 0.15.0-alpha.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25264,6 +25264,8 @@ var UPDATE_HEALTH_TIMEOUT_MS = 12e4;
25264
25264
  var UPDATE_HEALTH_INTERVAL_MS = 5e3;
25265
25265
  var HEALTH_REQUEST_TIMEOUT_MS = 5e3;
25266
25266
  var CHECKSUM_BUFFER_BYTES = 1024 * 1024;
25267
+ var ENV_BACKUP_PREFIX = ".env.openmates-backup-";
25268
+ var ENV_BACKUP_RETENTION_COUNT = 5;
25267
25269
  var IMAGE_CHANNEL_TAGS = {
25268
25270
  stable: MAIN_BRANCH,
25269
25271
  main: MAIN_BRANCH,
@@ -26006,12 +26008,19 @@ function readEnvContent(installPath) {
26006
26008
  const envPath = envPathForInstall(installPath);
26007
26009
  return existsSync8(envPath) ? readFileSync6(envPath, "utf-8") : "";
26008
26010
  }
26011
+ function pruneEnvBackups(installPath) {
26012
+ const backups = readdirSync3(installPath, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.startsWith(ENV_BACKUP_PREFIX)).map((entry) => entry.name).sort();
26013
+ for (const backup of backups.slice(0, Math.max(0, backups.length - ENV_BACKUP_RETENTION_COUNT))) {
26014
+ rmSync4(join6(installPath, backup), { force: true });
26015
+ }
26016
+ }
26009
26017
  function backupEnvFile(installPath) {
26010
26018
  const envPath = envPathForInstall(installPath);
26011
26019
  if (!existsSync8(envPath)) return null;
26012
- const backupPath = join6(installPath, `.env.openmates-backup-${nowStamp()}`);
26020
+ const backupPath = join6(installPath, `${ENV_BACKUP_PREFIX}${nowStamp()}`);
26013
26021
  copyFileSync2(envPath, backupPath);
26014
26022
  chmodSync3(backupPath, 384);
26023
+ pruneEnvBackups(installPath);
26015
26024
  return backupPath;
26016
26025
  }
26017
26026
  function writeEnvContent(installPath, content) {
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  requireExactConfirmation,
6
6
  resolveProjectContext,
7
7
  serializeToYaml
8
- } from "./chunk-IK5JH4VH.js";
8
+ } from "./chunk-YON2V5WM.js";
9
9
  import "./chunk-IWKP55ZB.js";
10
10
  import "./chunk-MLWBMJEN.js";
11
11
  export {
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  renderPlanList,
37
37
  renderSupportInfo,
38
38
  serializeToYaml
39
- } from "./chunk-IK5JH4VH.js";
39
+ } from "./chunk-YON2V5WM.js";
40
40
  import "./chunk-IWKP55ZB.js";
41
41
  import "./chunk-MLWBMJEN.js";
42
42
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.15.0-alpha.113",
3
+ "version": "0.15.0-alpha.115",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",