format code

This commit is contained in:
Opportunity
2021-07-16 11:03:34 +08:00
Unverified
parent 1ff6af7af3
commit 28277cf90d
7 changed files with 87 additions and 81 deletions
Vendored
+12 -9
View File
@@ -1,10 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
exports.cleanup = exports.create = exports.lsRemote = void 0;
const exec_1 = require("@actions/exec");
const io = require("@actions/io");
const os = require("os");
const path = require("path");
const exec_1 = require('@actions/exec');
const io = require('@actions/io');
const os = require('os');
const path = require('path');
function makeOpt(ref) {
return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) };
}
@@ -27,8 +27,7 @@ async function lsRemote(repo) {
const seg = tagPath[i];
if (typeof ldata[seg] === 'object') {
ldata = ldata[seg];
}
else {
} else {
ldata = ldata[seg] = {};
}
}
@@ -44,7 +43,11 @@ async function create(repo, ref) {
await io.mkdirP(opt.cwd);
await exec_1.exec('git', ['init'], opt);
await exec_1.exec('git', ['remote', 'add', 'origin', repoUrl(repo)], opt);
await exec_1.exec('git', ['fetch', 'origin', '+refs/pull/*:refs/remotes/origin/pull/*', '+refs/heads/*:refs/remotes/origin/*'], opt);
await exec_1.exec(
'git',
['fetch', 'origin', '+refs/pull/*:refs/remotes/origin/pull/*', '+refs/heads/*:refs/remotes/origin/*'],
opt,
);
await exec_1.exec('git', ['checkout', ref], opt);
await exec_1.exec('git', ['submodule', 'update', '--init', '--recursive'], opt);
return opt.cwd;