From 838a9424b6ca23858813eb56c05ed170626cf51d Mon Sep 17 00:00:00 2001 From: Seshan Ravikumar Date: Thu, 22 Sep 2022 17:26:59 -0400 Subject: [PATCH] actual fix --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index a40bfe8..7ba218f 100755 --- a/src/index.ts +++ b/src/index.ts @@ -107,10 +107,10 @@ async function buildPackage(pkg: Package) { // check if rebuilding is nessesary by compare rev-parse of local and remote try { - //const remoteRev = exec(`git -C ${pkgDir}/src/${pkg.name} rev-parse @{u}`, false).toString().trim(); - //const localRev = exec(`git -C ${pkgDir}/src/${pkg.name} rev-parse @`, false).toString().trim(); - const isUpToDate = exec(`git -C ${pkgDir}/src/${pkg.name} fetch --dry-run`, false).toString().trim() == ""; - if (isUpToDate) { + exec(`git -C ${pkgDir}/src/${pkg.name} fetch`); + const remoteRev = exec(`git -C ${pkgDir}/src/${pkg.name} rev-parse @{u}`, false).toString().trim(); + const localRev = exec(`git -C ${pkgDir}/src/${pkg.name} rev-parse @`, false).toString().trim(); + if (remoteRev === localRev) { console.log("📦 -> Already up to date (upstream), skipping"); return; } else {