[build] generate proto clasess
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const tmp = require('tmp-file');
|
||||
const exec = require('./exec');
|
||||
@@ -15,9 +14,9 @@ const log = require('fancy-log');
|
||||
class Haxe extends Sdk {
|
||||
|
||||
getBin(name) {
|
||||
if (os.type() === 'Windows_NT') {
|
||||
if (Sdk.System.isWindows) {
|
||||
return `${this.binPath}/${name}.exe`;
|
||||
} else if (os.type() === 'Linux') {
|
||||
} else if (Sdk.System.isLinux) {
|
||||
const binPath = `${this.binPath}/${name}`;
|
||||
fs.chmodSync(binPath, 0o755);
|
||||
return binPath;
|
||||
@@ -50,12 +49,10 @@ class Haxe extends Sdk {
|
||||
}
|
||||
|
||||
get link() {
|
||||
if (os.type() === 'Windows_NT') {
|
||||
if (Sdk.System.isWindows) {
|
||||
return `https://github.com/HaxeFoundation/haxe/releases/download/${this.version}/haxe-${this.version}-win.zip`;
|
||||
} else if (os.type() === 'Linux') {
|
||||
let arch = null;
|
||||
if (os.arch() === 'ia32') { arch = '32'}
|
||||
if (os.arch() === 'x64') { arch = '64'}
|
||||
} else if (Sdk.System.isLinux) {
|
||||
let arch = Sdk.System.archInt;
|
||||
return `https://github.com/HaxeFoundation/haxe/releases/download/${this.version}/haxe-${this.version}-linux${arch}.tar.gz`;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +63,8 @@ class Haxe extends Sdk {
|
||||
|
||||
haxelib(args) {
|
||||
const haxelibBin = this.haxelibBin;
|
||||
return exec(this.binPath, [path.basename(haxelibBin)].concat(args).join(' '));
|
||||
//return exec(this.binPath, [path.basename(haxelibBin)].concat(args).join(' '));
|
||||
return exec('.', [haxelibBin].concat(args).join(' '));
|
||||
}
|
||||
|
||||
install(packages) {
|
||||
|
||||
Reference in New Issue
Block a user