1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const path = require("path");
|
4 | const fs_1 = require("./fs");
|
5 | async function writeGitCredentials(ctx) {
|
6 | const homeDir = path.join(ctx.codedir, '.home');
|
7 | await fs_1.fsMkdir(homeDir);
|
8 | const gitCredentials = ctx.env.get('GIT_CREDENTIALS', '');
|
9 | if (gitCredentials) {
|
10 | await fs_1.fsWriteFile(path.join(homeDir, '.git-credentials'), gitCredentials);
|
11 | await fs_1.fsWriteFile(path.join(homeDir, '.gitconfig'), '[credential]\nhelper = store\n');
|
12 | }
|
13 | }
|
14 | exports.writeGitCredentials = writeGitCredentials;
|