clean files

This commit is contained in:
Opportunity
2021-07-16 11:08:18 +08:00
Unverified
parent 28277cf90d
commit 1d3e0c37b9
8 changed files with 81 additions and 88 deletions
Vendored
+9 -12
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,7 +27,8 @@ async function lsRemote(repo) {
const seg = tagPath[i];
if (typeof ldata[seg] === 'object') {
ldata = ldata[seg];
} else {
}
else {
ldata = ldata[seg] = {};
}
}
@@ -43,11 +44,7 @@ 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;