@muhammedaksam/easiarr 1.1.7 → 1.1.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muhammedaksam/easiarr",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "TUI tool for generating docker-compose files for the *arr media ecosystem with 41 apps, TRaSH Guides best practices, VPN routing, and Traefik reverse proxy support",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -6,7 +6,7 @@
6
6
  * Each migration exports: name, up()
7
7
  */
8
8
 
9
- import { existsSync, readFileSync, writeFileSync } from "node:fs"
9
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"
10
10
  import { join } from "node:path"
11
11
  import { homedir } from "node:os"
12
12
  import { debugLog } from "./debug"
@@ -26,6 +26,15 @@ interface Migration {
26
26
  down: () => boolean
27
27
  }
28
28
 
29
+ /**
30
+ * Ensure the easiarr directory exists
31
+ */
32
+ function ensureEasiarrDir(): void {
33
+ if (!existsSync(EASIARR_DIR)) {
34
+ mkdirSync(EASIARR_DIR, { recursive: true })
35
+ }
36
+ }
37
+
29
38
  /**
30
39
  * Get the current migration state
31
40
  */
@@ -46,6 +55,7 @@ function getMigrationState(): MigrationState {
46
55
  * Save the migration state
47
56
  */
48
57
  function saveMigrationState(state: MigrationState): void {
58
+ ensureEasiarrDir()
49
59
  state.lastRun = new Date().toISOString()
50
60
  writeFileSync(MIGRATIONS_FILE, JSON.stringify(state, null, 2), "utf-8")
51
61
  }