diff --git a/src/commands/src/helpers.ts b/src/commands/src/helpers.ts index 74dd2b06f..3e9af1fa6 100644 --- a/src/commands/src/helpers.ts +++ b/src/commands/src/helpers.ts @@ -93,6 +93,20 @@ export async function getPatchId(repoDir: string): Promise { return gitPatchId.slice(0, 7); } +export async function addProjectToEnv(project: string) { + return new Promise((resolve, reject) => { + const stream = fs.createWriteStream(path.join(__dirname, 'snooty/.env.production'), { flags: 'a+' }); + + stream.write(project); + stream.close(); + stream.on('error', (error) => { + console.log('Error when writing to file!', error); + reject(error); + }); + stream.on('close', resolve); + }); +} + export async function getCommitHash(): Promise { // equivalent to git rev-parse --short HEAD const response = await executeCliCommand({ command: 'git', args: ['rev-parse', '--short', 'HEAD'] });