Skip to content

Commit

Permalink
Merge pull request #6 from VRLabs/feature/add-2019-support
Browse files Browse the repository at this point in the history
Add 2019 support
  • Loading branch information
jellejurre authored Mar 20, 2024
2 parents 788fca8 + 6fd28cc commit 1cc70a6
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Instancer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,24 @@ static string PrepareTargetFolderPath(string folderPath, string packageName)
static string GetSourceFolder(string installFilePath)
{
string sourceFolder = installFilePath;

#if UNITY_2019
while (!File.Exists("." + sourceFolder + "/package.json"))
#else
while (!File.Exists(sourceFolder + "/package.json"))
#endif
{
sourceFolder = Path.GetDirectoryName(sourceFolder);
if (sourceFolder == null)
{
throw new ArgumentException("Supplied path not in correct format");
}
sourceFolder = Path.GetDirectoryName(sourceFolder);
}

return sourceFolder.Replace("\\", "/");

#if UNITY_2019
return sourceFolder.Replace("\\", "/").Substring(1);
#else
return sourceFolder.Replace("\\", "/").Substring(2);
#endif
}

static string[] GetLocalAssetPaths(string sourceFolder, string[] excludeRegexs)
Expand Down

0 comments on commit 1cc70a6

Please sign in to comment.