Skip to content

Commit

Permalink
Merge pull request #49 from kyubuns/master
Browse files Browse the repository at this point in the history
fix: #48 package-lock.json is not synchronized when build failed
  • Loading branch information
314pies committed Jul 2, 2021
2 parents bb3d506 + 3b69099 commit 44b8322
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ParrelSync/Editor/ClonesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ public static void OpenProject(string projectPath)
return;
}

ParrelSync.NonCore.ValidateCopiedFoldersIntegrity.ValidateFolder(projectPath, ClonesManager.GetOriginalProjectPath(), "Packages");

string fileName = GetApplicationPath();
string args = "-projectPath \"" + projectPath + "\"";
Debug.Log("Opening project \"" + fileName + " " + args + "\"");
Expand Down
8 changes: 4 additions & 4 deletions ParrelSync/Editor/ValidateCopiedFoldersIntegrity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ static ValidateCopiedFoldersIntegrity()
SessionState.SetBool(SessionStateKey, true);
if (!ClonesManager.IsClone()) { return; }

ValidateFolder("Packages");
ValidateFolder(ClonesManager.GetCurrentProjectPath(), ClonesManager.GetOriginalProjectPath(), "Packages");
}
}

static void ValidateFolder(string folderName)
public static void ValidateFolder(string current, string original, string folderName)
{
var currentProjectPath = Path.Combine(ClonesManager.GetCurrentProjectPath(), folderName);
var currentProjectPath = Path.Combine(current, folderName);
var currentFolderHash = CreateMd5ForFolder(currentProjectPath);

var originalProjectPath = Path.Combine(ClonesManager.GetOriginalProjectPath(), folderName);
var originalProjectPath = Path.Combine(original, folderName);
var originalFolderHash = CreateMd5ForFolder(originalProjectPath);

if (currentFolderHash != originalFolderHash)
Expand Down

0 comments on commit 44b8322

Please sign in to comment.