Skip to content

Instantly share code, notes, and snippets.

@SjB
Last active September 23, 2015 17:50
Show Gist options
  • Select an option

  • Save SjB/dbfe069cf3f42b074c68 to your computer and use it in GitHub Desktop.

Select an option

Save SjB/dbfe069cf3f42b074c68 to your computer and use it in GitHub Desktop.
Package function
Action<DirectoryPath, FilePath> Package = delegate(DirectoryPath path, FilePath zipfile) {
Information("Package: {0} into {1}", path.ToString(), zipfile.ToString());
if (IsRunningOnUnix()) {
var processArgs = new ProcessArgumentBuilder();
processArgs.Append("-r");
processArgs.Append(zipfile.ToString());
processArgs.Append(".");
var wd = (Directory(path.ToString()));
Information(wd.ToString());
StartProcess("zip", new ProcessSettings { WorkingDirectory = wd, Arguments = processArgs });
} else {
Zip(path, zipfile);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment