Skip to content

Commit

Permalink
Fix #29
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadoum committed Apr 3, 2024
1 parent 4e8e744 commit b9fbb01
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions source/sideload/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b9fbb01

Please sign in to comment.