From b9fbb01d76febc8c15fae28a5bb0a38487b0c6ce Mon Sep 17 00:00:00 2001 From: Dadoum Date: Wed, 3 Apr 2024 22:16:56 +0200 Subject: [PATCH] Fix #29 --- source/sideload/package.d | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/source/sideload/package.d b/source/sideload/package.d index d4e2570..a5fd7f7 100644 --- a/source/sideload/package.d +++ b/source/sideload/package.d @@ -161,7 +161,7 @@ void sideloadFull( "PackageType", "Developer" ); - auto remoteAppFolder = stagingDir.buildPath(baseName(app.bundleDir)); + auto remoteAppFolder = stagingDir.buildPath(baseName(app.bundleDir)).toForwardSlashes(); if (afcClient.getFileInfo(remoteAppFolder, props) != AFCError.AFC_E_SUCCESS) { // The directory does not exist, so let's create it! afcClient.makeDirectory(remoteAppFolder).assertSuccess(); @@ -172,7 +172,7 @@ void sideloadFull( auto transferStep = 3 / (STEP_COUNT * files.length * 4); foreach (f; files) { - auto remotePath = remoteAppFolder.buildPath(f.asRelativePath(app.bundleDir).array()); + auto remotePath = remoteAppFolder.buildPath(f.asRelativePath(app.bundleDir).array()).toForwardSlashes();; if (f.isDir()) { afcClient.makeDirectory(remotePath); } else { @@ -223,13 +223,25 @@ void sideloadFull( } }); receive( - (immutable(Exception) t) => throw t, - (typeof(null)) {} + (immutable(Exception) t) => throw t, + (typeof(null)) {} ); progressCallback(1.0, "Done!"); } +pragma(inline, true) +private string toForwardSlashes(string s) { + version (Windows) { + foreach (ref c; remoteAppFolder) { + if (c == '\\') { + c = '/'; + } + } + } + return s; +} + class NoAppIdRemainingException: Exception { this(DateTime minExpirationDate, string file = __FILE__, int line = __LINE__) { super(format!"Cannot make any more app ID, you have to wait until %s to get a new app ID"(minExpirationDate.toSimpleString()), file, line);