(a: string, b: string)
| 5 | const GHCR_BASE = 'ghcr.io/learnhouse/app' |
| 6 | |
| 7 | function compareVersions(a: string, b: string): number { |
| 8 | const pa = a.split('.').map(Number) |
| 9 | const pb = b.split('.').map(Number) |
| 10 | for (let i = 0; i < 3; i++) { |
| 11 | if ((pa[i] || 0) > (pb[i] || 0)) return 1 |
| 12 | if ((pa[i] || 0) < (pb[i] || 0)) return -1 |
| 13 | } |
| 14 | return 0 |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Check npm for the latest version and warn if outdated. |