(options: Options)
| 84 | function warnAboutMissingTrackedDefault(name: string): void { |
| 85 | const border = '='.repeat(78); |
| 86 | console.warn(` |
| 87 | \x1b[1;33m${border} |
| 88 | NO TRACKED ENV DEFAULT WILL BE ADDED |
| 89 | |
| 90 | Make sure the application can start and run without ${name}. If the code requires |
| 91 | this variable, external contributors without access to shared secrets will run |
| 92 | into setup, test, or build failures. |
| 93 | ${border}\x1b[0m |
| 94 | `); |
| 95 | } |
| 96 | |
| 97 | function assignmentValue(content: string, name: string): string | undefined { |
| 98 | const assignment = content.split('\n').find(line => line.startsWith(`${name}=`)); |
| 99 | if (!assignment) return undefined; |
| 100 | const value = assignment.slice(name.length + 1); |
| 101 | try { |
| 102 | const parsed: unknown = JSON.parse(value); |
| 103 | return typeof parsed === 'string' ? parsed : value; |
| 104 | } catch { |
| 105 | return value; |
| 106 | } |
| 107 | } |
no test coverage detected