forked from openfl/lime
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDeploymentHelper.hx
More file actions
36 lines (28 loc) · 879 Bytes
/
DeploymentHelper.hx
File metadata and controls
36 lines (28 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package lime.tools;
import hxp.*;
import lime.tools.HXProject;
class DeploymentHelper
{
public static function deploy(project:HXProject, targetFlags:Map<String, String>, targetDirectory:String, targetName:String)
{
var name = project.meta.title + " (" + project.meta.version + " build " + project.meta.buildNumber + ") (" + targetName + ").zip";
var targetPath = Path.combine(targetDirectory + "/dist", name);
System.compress(Path.combine(targetDirectory, "bin"), targetPath);
if (targetFlags.exists("gdrive"))
{
var parent = targetFlags.get("parent");
var args = ["upload", "-f", targetPath];
if (targetFlags.exists("config"))
{
args.push("--config");
args.push(targetFlags.get("config"));
}
if (parent != null && parent != "")
{
args.push("-p");
args.push(parent);
}
System.runCommand("", "drive", args);
}
}
}