Skip to content

Commit

Permalink
Minor run script fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jgranick committed Jul 17, 2017
1 parent 74b141e commit b21c5d0
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tools/RunScript.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,19 @@ class RunScript {
public static function main () {

var args = Sys.args ();
var cacheDirectory = Sys.getCwd ();
var workingDirectory = args.pop ();

try {

Sys.setCwd (workingDirectory);

} catch (e:Dynamic) {

LogHelper.error ("Cannot set current working directory to \"" + workingDirectory + "\"");

}

if (args.length > 1 && args[0] == "create") {

//args[1] = "openfl:" + args[1];
Expand All @@ -49,6 +60,8 @@ class RunScript {

} else if (args.length > 0 && args[0] == "process") {

Sys.setCwd (cacheDirectory);

if (!FileSystem.exists ("tools/tools.n")) {

rebuildTools ();
Expand All @@ -61,17 +74,6 @@ class RunScript {
}

var args = [ "run", "lime" ].concat (args);

try {

Sys.setCwd (workingDirectory);

} catch (e:Dynamic) {

LogHelper.error ("Cannot set current working directory to \"" + workingDirectory + "\"");

}

Sys.exit (Sys.command ("haxelib", args.concat ([ "-openfl" ])));

}
Expand Down

0 comments on commit b21c5d0

Please sign in to comment.