Fix cp arguments to match previous behavior

This commit is contained in:
caesay
2024-03-08 09:48:09 +00:00
parent e497a3d5ae
commit 0bffac3c99
2 changed files with 9 additions and 2 deletions

View File

@@ -76,7 +76,11 @@ public class OsxBuildTools
throw new ArgumentException("Source directory does not exist: " + source);
}
Log.Debug($"Copying '{source}' to '{dest}' (preserving symlinks)");
Log.Debug(Exe.InvokeAndThrowIfNonZero("cp", new[] { "-a", source, dest }, null));
// copy the contents of the folder, not the folder itself.
var src = source.TrimEnd('/') + "/.";
var des = dest.TrimEnd('/') + "/";
Log.Debug(Exe.InvokeAndThrowIfNonZero("cp", new[] { "-a", src, des }, null));
}
public void CreateInstallerPkg(string appBundlePath, string appTitle, string appId, IEnumerable<KeyValuePair<string, string>> extraContent,

View File

@@ -326,7 +326,10 @@ public abstract class PackageBuilder<T> : ICommand<T>
CopyFilesInternal(source, target);
} else {
Log.Debug($"Copying '{source}' to '{target}' (preserving symlinks)");
Log.Debug(Exe.InvokeAndThrowIfNonZero("cp", new[] { "-a", source.FullName, target.FullName }, null));
// copy the contents of the folder, not the folder itself.
var src = source.FullName.TrimEnd('/') + "/.";
var dest = target.FullName.TrimEnd('/') + "/";
Log.Debug(Exe.InvokeAndThrowIfNonZero("cp", new[] { "-a", src, dest }, null));
if (excludeAnnoyances) {
foreach (var f in target.EnumerateFiles("*", SearchOption.AllDirectories)) {