Skip to content

Commit

Permalink
Fixed packages installer (#784)
Browse files Browse the repository at this point in the history
* fixed packages installer

updated string extensions bc if was super confusing and poorly written

* bumped project version to 0.2.7

* added repo source url to package info

* updated submodules
  • Loading branch information
StephenHodgson committed Feb 12, 2021
1 parent 7d2d803 commit aeb252f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Editor/PackageInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static string CopyAsset(this string rootPath, string sourceAssetPath, st
{
sourceAssetPath = sourceAssetPath.ToForwardSlashes();
destinationPath = $"{destinationPath}{sourceAssetPath.Replace(Path.GetFullPath(rootPath), string.Empty)}".ToForwardSlashes();
destinationPath = Path.Combine(Directory.GetParent(Application.dataPath).FullName, destinationPath);
destinationPath = Path.Combine(Directory.GetParent(Application.dataPath).FullName, destinationPath).ToForwardSlashes();

if (!File.Exists(destinationPath))
{
Expand Down
14 changes: 7 additions & 7 deletions Runtime/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
Expand All @@ -13,9 +13,9 @@ public static class StringExtensions
{
public const string WhiteSpace = " ";

public const string Backslash = "\\";
public const string ForwardSlash = "\\";

public const string ForwardSlash = "/";
public const string BackSlash = "/";

/// <summary>
/// Encodes the string to base 64 ASCII.
Expand Down Expand Up @@ -77,22 +77,22 @@ public static string ToProperCase(this string value)
}

/// <summary>
/// Replaces all back slashes in the string with forward slashes.
/// Replaces all forward slashes in the string with back slashes.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string ToBackSlashes(this string value)
{
return value.Replace(Backslash, ForwardSlash);
return value.Replace(ForwardSlash, BackSlash);
}

/// <summary>
/// Replaces all backslashes in the string with forward slashes.
/// Replaces all back slashes in the string with forward slashes.
/// </summary>
/// <param name="value"></param>
public static string ToForwardSlashes(this string value)
{
return value.Replace(ForwardSlash, Backslash);
return value.Replace(BackSlash, ForwardSlash);
}
}
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
"Mixed Reality",
"DI"
],
"version": "0.2.6",
"version": "0.2.7",
"unity": "2019.4",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/XRTK/XRTK-Core.git"
},
"author": "XRTK Team (https://github.com/XRTK)",
"dependencies": {
"com.unity.ugui": "1.0.0",
Expand Down

0 comments on commit aeb252f

Please sign in to comment.