From f8512fab75149ca822764da2351deb185c80d851 Mon Sep 17 00:00:00 2001 From: Kevin Olson Date: Thu, 26 Nov 2020 00:57:20 -0600 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20attempt=20to=20pull=20in?= =?UTF-8?q?=20from=20a=20piped=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/deployment.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/deployment.ts b/src/lib/deployment.ts index b844f50..b0d1d63 100644 --- a/src/lib/deployment.ts +++ b/src/lib/deployment.ts @@ -2,6 +2,7 @@ import {Auth} from './auth' import {YamlConfig, Entry, AwsClientConfig, FumeEnvironment, S3Config} from './types' import execa from 'execa' import { execSync } from 'child_process' +import * as fs from "fs"; export default class Deployment { auth: Auth @@ -18,10 +19,12 @@ export default class Deployment { } async initialize(environment: string) { + execSync('git log --decorate=short -n 1 > git_log_fume_cli.txt') const data = { env: environment, - commit: execSync('git log --decorate=short -n 1').toString(), + commit: fs.readFileSync('git_log_fume_cli.txt', 'utf8'), } + fs.unlinkSync('git_log_fume_cli.txt') this.entry = (await this.auth.axios.post(`/project/${this.config.id}/dep`, data)).data.data.data this.s3 = (await this.auth.axios.get(`/project/${this.config.id}/dep/${this.entry.id}/s3`)).data.data this.s3.path = `${__dirname}/${this.s3.file}`