UNPKG

601 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const path = require("path");
4const fs_1 = require("./fs");
5async 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}
14exports.writeGitCredentials = writeGitCredentials;