|
|
|
@ -4807,7 +4807,7 @@ const gitCommandManager = __importStar(__webpack_require__(289));
|
|
|
|
|
const io = __importStar(__webpack_require__(1));
|
|
|
|
|
const path = __importStar(__webpack_require__(622));
|
|
|
|
|
const refHelper = __importStar(__webpack_require__(227));
|
|
|
|
|
const repositoryApiHelper = __importStar(__webpack_require__(610));
|
|
|
|
|
const githubApiHelper = __importStar(__webpack_require__(464));
|
|
|
|
|
const authConfigKey = `http.https://github.com/.extraheader`;
|
|
|
|
|
function getSource(settings) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
@ -4844,7 +4844,7 @@ function getSource(settings) {
|
|
|
|
|
yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
|
|
|
|
|
}
|
|
|
|
|
if (!git || `${1}` == '1') {
|
|
|
|
|
yield repositoryApiHelper.download(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
|
|
|
|
|
yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Initialize the repository
|
|
|
|
@ -8063,6 +8063,50 @@ exports.RequestError = RequestError;
|
|
|
|
|
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 464:
|
|
|
|
|
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
|
var result = {};
|
|
|
|
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
|
|
|
result["default"] = mod;
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
|
const github = __importStar(__webpack_require__(469));
|
|
|
|
|
const IS_WINDOWS = process.platform === 'win32';
|
|
|
|
|
function downloadRepository(accessToken, owner, repo, ref, repositoryPath) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
const octokit = new github.GitHub(accessToken);
|
|
|
|
|
const params = {
|
|
|
|
|
archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
|
|
|
|
|
owner: owner,
|
|
|
|
|
repo: repo,
|
|
|
|
|
ref: ref
|
|
|
|
|
};
|
|
|
|
|
const response = yield octokit.repos.getArchiveLink(params);
|
|
|
|
|
console.log(`status=${response.status}`);
|
|
|
|
|
console.log(`headers=${JSON.stringify(response.headers)}`);
|
|
|
|
|
console.log(`data=${JSON.stringify(typeof (response.data))}`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
exports.downloadRepository = downloadRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 469:
|
|
|
|
@ -8932,50 +8976,6 @@ function octokitRestApiEndpoints(octokit) {
|
|
|
|
|
|
|
|
|
|
module.exports = require("http");
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 610:
|
|
|
|
|
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
|
var result = {};
|
|
|
|
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
|
|
|
result["default"] = mod;
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
|
const github = __importStar(__webpack_require__(469));
|
|
|
|
|
const IS_WINDOWS = process.platform === 'win32';
|
|
|
|
|
function download(accessToken, owner, repo, ref, repositoryPath) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
const octokit = new github.GitHub(accessToken);
|
|
|
|
|
const params = {
|
|
|
|
|
archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
|
|
|
|
|
owner: owner,
|
|
|
|
|
repo: repo,
|
|
|
|
|
ref: ref
|
|
|
|
|
};
|
|
|
|
|
const response = yield octokit.repos.getArchiveLink(params);
|
|
|
|
|
console.log(`status=${response.status}`);
|
|
|
|
|
console.log(`headers=${JSON.stringify(response.headers)}`);
|
|
|
|
|
console.log(`data=${JSON.stringify(response.data)}`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
exports.download = download;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 614:
|
|
|
|
|