|
@@ -48,10 +48,17 @@ class File {
|
|
|
}
|
|
|
|
|
|
public static function copy( srcPath : String, dstPath : String ) : Void {
|
|
|
- switch (Sys.systemName()) {
|
|
|
+ var result = switch (Sys.systemName()) {
|
|
|
case "Windows" : Os.execute('copy ${StringTools.quoteWinArg(srcPath, true)} ${StringTools.quoteWinArg(dstPath,true)}');
|
|
|
default : Os.execute('cp ${StringTools.quoteUnixArg(srcPath)} ${StringTools.quoteUnixArg(dstPath)}');
|
|
|
};
|
|
|
+ if(
|
|
|
+ #if (lua_ver >= 5.2) !result.success
|
|
|
+ #elseif (lua_ver < 5.2) result != 0
|
|
|
+ #else ((result:Dynamic) != true && (result:Dynamic) != 0) #end
|
|
|
+ ) {
|
|
|
+ throw 'Failed to copy $srcPath to $dstPath';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static function getBytes( path : String ) : haxe.io.Bytes {
|