From 8a16909813778913b650a394f9f6cfc384261b5e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 2 Nov 2023 04:12:15 +0000 Subject: [PATCH] feat(git-tag): if already cloned, fetch to update --- _common/git-tag.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_common/git-tag.js b/_common/git-tag.js index 5ec1fe6..aea7592 100644 --- a/_common/git-tag.js +++ b/_common/git-tag.js @@ -36,6 +36,10 @@ Repos.checkExists = async function (repoPath) { return false; }; +Repos.fetch = async function (repoPath) { + await exec(`git --git-dir=${repoPath} fetch`); +}; + Repos.getTags = async function (repoPath) { var { stdout } = await exec(`git --git-dir=${repoPath} tag`); var rawTags = stdout.trim().split('\n'); @@ -91,6 +95,8 @@ async function getAllReleases(gitUrl) { let isCloned = await Repos.checkExists(repoPath); if (!isCloned) { await Repos.clone(repoPath, gitUrl); + } else { + await Repos.fetch(repoPath); } let commitInfos = [];