@remits/remits-cli 0.1.70 → 0.1.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +16 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -737,6 +737,17 @@ function setPlatformRepoEntry(directory, source) {
737
737
  return index[PLATFORM_REPO_INVENTORY_KEY];
738
738
  }
739
739
 
740
+ function readGitRemoteUrl(dir, remoteName) {
741
+ try {
742
+ return execSync(
743
+ 'git -C ' + shellQuote(dir) + ' remote get-url ' + shellQuote(remoteName),
744
+ { stdio: ['ignore', 'pipe', 'ignore'] }
745
+ ).toString().trim();
746
+ } catch (_) {
747
+ return null;
748
+ }
749
+ }
750
+
740
751
  // Fast-forward an existing platform repo so back-stage analysis runs against
741
752
  // up-to-date code. Best-effort and safe: skips a dirty tree (never clobbers
742
753
  // local work) and uses --ff-only so it no-ops rather than creating merge
@@ -753,6 +764,11 @@ function maybePullPlatformRepo(dir, options) {
753
764
  console.log('[platform] Skipping git pull: ' + dir + ' has uncommitted changes.');
754
765
  return;
755
766
  }
767
+ const originUrl = readGitRemoteUrl(dir, 'origin');
768
+ if (originUrl && originUrl !== PLATFORM_REPO_GIT_URL) {
769
+ console.log('[platform] Found Remits platform repo at ' + dir + ', but its origin remote is ' + originUrl + ' (expected ' + PLATFORM_REPO_GIT_URL + ').');
770
+ console.log('[platform] Fix it with: git -C ' + dir + ' remote set-url origin ' + PLATFORM_REPO_GIT_URL);
771
+ }
756
772
  console.log('[platform] Updating Remits platform repo (git pull)...');
757
773
  execSync('git -C ' + shellQuote(dir) + ' pull --ff-only', { stdio: 'inherit' });
758
774
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remits/remits-cli",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "description": "Local CLI for auth, component sync, and live test execution against Remits",
5
5
  "license": "MIT",
6
6
  "private": false,