diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-07-01 10:12:55 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-07-01 10:12:55 -0700 |
commit | 8fbbe6396f400a9a50d4686c39969470edf2a246 (patch) | |
tree | 4832c535816d59b30bbf7eb059259194a3bfc46c /worker/scripts/ansible_playbook.ts | |
parent | fd5fb8b5e19bb6b09ed6e2a6050ba6c4a375d520 (diff) | |
download | ci-8fbbe6396f400a9a50d4686c39969470edf2a246.tar.gz ci-8fbbe6396f400a9a50d4686c39969470edf2a246.zip |
Lift all utility functions in runner scripts
Diffstat (limited to 'worker/scripts/ansible_playbook.ts')
-rwxr-xr-x | worker/scripts/ansible_playbook.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/worker/scripts/ansible_playbook.ts b/worker/scripts/ansible_playbook.ts index fb4b801..4ec3ffa 100755 --- a/worker/scripts/ansible_playbook.ts +++ b/worker/scripts/ansible_playbook.ts @@ -90,11 +90,12 @@ await LogMetricTraceable.ofLogTraceable(_logJob) }) .get(); -const saveToTempFile = (text: string): Promise<IEither<Error, string>> => - Either.fromFailableAsync(() => +function saveToTempFile(text: string): Promise<IEither<Error, string>> { + return Either.fromFailableAsync(() => mkdtemp(join(tmpdir(), 'ci-')).then(async (dir) => { const filePath = join(dir, 'temp-file'); await writeFile(filePath, text); return filePath; }), ); +} |