vibe-config-sync 0.2.2 → 0.2.3

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/dist/index.js +14 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -695,8 +695,15 @@ async function pullFromRemote(git) {
695
695
  try {
696
696
  await git.pull();
697
697
  } catch {
698
- await git.pull("origin", branch);
699
- await git.branch(["--set-upstream-to=origin/" + branch, branch]);
698
+ try {
699
+ await git.pull("origin", branch);
700
+ await git.branch(["--set-upstream-to=origin/" + branch, branch]);
701
+ } catch {
702
+ logWarn("Merge conflict detected, resetting to remote version");
703
+ await git.fetch("origin", branch);
704
+ await git.reset(["--hard", `origin/${branch}`]);
705
+ await git.branch(["--set-upstream-to=origin/" + branch, branch]);
706
+ }
700
707
  }
701
708
  logOk("Pulled from remote");
702
709
  }
@@ -780,10 +787,6 @@ async function cmdInit() {
780
787
  return;
781
788
  }
782
789
  fs8.ensureDirSync(SYNC_DIR);
783
- fs8.writeFileSync(
784
- path9.join(SYNC_DIR, ".gitignore"),
785
- ".DS_Store\nThumbs.db\n"
786
- );
787
790
  const git = createGit(SYNC_DIR);
788
791
  await git.init();
789
792
  logOk("Initialized git repository");
@@ -802,6 +805,10 @@ async function cmdInit() {
802
805
  logInfo("No existing data on remote (new repository)");
803
806
  }
804
807
  }
808
+ const gitignorePath = path9.join(SYNC_DIR, ".gitignore");
809
+ if (!fs8.existsSync(gitignorePath)) {
810
+ fs8.writeFileSync(gitignorePath, ".DS_Store\nThumbs.db\n");
811
+ }
805
812
  console.log("");
806
813
  logOk("Setup complete!");
807
814
  console.log("");
@@ -841,7 +848,7 @@ function cmdRestore(timestamp) {
841
848
 
842
849
  // src/index.ts
843
850
  var program = new Command();
844
- program.name("vibe-sync").description("Sync AI coding tool configurations across machines via git").version("0.2.2").action(async () => {
851
+ program.name("vibe-sync").description("Sync AI coding tool configurations across machines via git").version("0.2.3").action(async () => {
845
852
  if (!isInitialized()) {
846
853
  await cmdInit();
847
854
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-config-sync",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Cross-platform CLI tool to sync AI coding tool configurations across machines via git",
5
5
  "type": "module",
6
6
  "bin": {