Skip to content

Commit 59701ee

Browse files
committed
AIRPlatform: validate that the AIR_SDK path exists and is a directory
Better to display an error early with the exact cause of the problem rather than letting it become an issue later
1 parent 3e4b5d0 commit 59701ee

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/platforms/AIRPlatform.hx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ class AIRPlatform extends FlashPlatform
133133
{
134134
Log.error("You must define AIR_SDK with the path to your AIR SDK");
135135
}
136+
else
137+
{
138+
var airSdk = project.environment.get("AIR_SDK");
139+
if (!FileSystem.exists(airSdk))
140+
{
141+
Log.error("The path specified for AIR_SDK does not exist: " + airSdk);
142+
Sys.exit(1);
143+
}
144+
if (!FileSystem.isDirectory(airSdk))
145+
{
146+
Log.error("The path specified for AIR_SDK must be a directory: " + airSdk);
147+
Sys.exit(1);
148+
}
149+
}
136150

137151
// TODO: Should we package on desktop in "deploy" command instead?
138152

0 commit comments

Comments
 (0)