[all] fixes for windows
This commit is contained in:
@@ -4,6 +4,7 @@ const fse = require('fs-extra');
|
||||
const path = require('path');
|
||||
const exec = require('./exec');
|
||||
const Sdk = require('./sdk');
|
||||
const System = require('./system');
|
||||
const Env = require('./env');
|
||||
const Neko = require('./neko');
|
||||
const vfs = require('vinyl-fs');
|
||||
@@ -13,9 +14,9 @@ const rename = require('gulp-rename');
|
||||
class Haxe extends Sdk {
|
||||
|
||||
getBin(name) {
|
||||
if (Sdk.System.isWindows) {
|
||||
if (System.isWindows) {
|
||||
return path.join(this.path, name + '.exe');
|
||||
} else if (Sdk.System.isLinux) {
|
||||
} else if (System.isLinux) {
|
||||
const binPath = path.join(this.path, name);
|
||||
if (fs.existsSync(binPath)) {
|
||||
fs.chmodSync(binPath, 0o755);
|
||||
@@ -62,10 +63,10 @@ class Haxe extends Sdk {
|
||||
}
|
||||
|
||||
get link() {
|
||||
if (Sdk.System.isWindows) {
|
||||
if (System.isWindows) {
|
||||
return `https://github.com/HaxeFoundation/haxe/releases/download/${this.version}/haxe-${this.version}-win.zip`;
|
||||
} else if (Sdk.System.isLinux) {
|
||||
let arch = Sdk.System.archInt;
|
||||
} else if (System.isLinux) {
|
||||
let arch = System.archInt;
|
||||
return `https://github.com/HaxeFoundation/haxe/releases/download/${this.version}/haxe-${this.version}-linux${arch}.tar.gz`;
|
||||
}
|
||||
}
|
||||
@@ -140,7 +141,7 @@ class Haxe extends Sdk {
|
||||
const target = path.resolve(buildDir, platform, 'bin');
|
||||
fse.emptyDirSync(target);
|
||||
for (const asset of config.assets) {
|
||||
fse.copySync(asset, path.join(target, asset.split(path.sep).pop()));
|
||||
fse.copySync(asset, path.join(target, asset.split("/").pop()));
|
||||
}
|
||||
return this.haxe(args).then(() => vfs.src(`${target}/**/*`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user