+5
-14
@@ -2,7 +2,6 @@ import fs from "fs";
|
||||
import fse from "fs-extra";
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
import env from "../common/env";
|
||||
import { System } from "../common/system";
|
||||
import { watch } from "../common/watch";
|
||||
import { Sdk } from "../core/sdk";
|
||||
@@ -26,12 +25,15 @@ export class FlashPlayer extends Sdk {
|
||||
BASE_URL = "https://fpdownload.macromedia.com/pub/flashplayer/updaters";
|
||||
|
||||
private debug: boolean;
|
||||
protected baseUrl: string;
|
||||
|
||||
url =
|
||||
"https://fpdownload.macromedia.com/pub/flashplayer/updaters/" +
|
||||
"<%= version %>/" +
|
||||
"<%= {linux:'flash_player_sa_linux' + (debug ? '_debug' : '') +'.x86_64.tar.gz','win':'flashplayer_'+version+'_sa'+(debug ? '_debug' : '')+'.exe'}[os_name] %>";
|
||||
|
||||
constructor(debug: boolean = false, version?: string, playerId = FlashPlayer.ID) {
|
||||
super(playerId, version || FlashPlayer.VERSION);
|
||||
this.debug = debug;
|
||||
this.baseUrl = env.get("FLASHPLAYER_URL") || this.BASE_URL;
|
||||
}
|
||||
|
||||
prepare() {
|
||||
@@ -46,17 +48,6 @@ export class FlashPlayer extends Sdk {
|
||||
}
|
||||
}
|
||||
|
||||
get link(): string {
|
||||
const baseUrl = `${this.baseUrl}/${this.version}`;
|
||||
if (System.isWindows) {
|
||||
return baseUrl + `/flashplayer_${this.version}_sa${this.debug ? "_debug" : ""}.exe`;
|
||||
} else if (System.isLinux) {
|
||||
return baseUrl + `/flash_player_sa_linux${this.debug ? "_debug" : ""}.x86_64.tar.gz`;
|
||||
} else {
|
||||
throw `Unsupported os '${os.type()}'`;
|
||||
}
|
||||
}
|
||||
|
||||
get flashPlayerBin(): string {
|
||||
if (System.isWindows) {
|
||||
const playerName = `flashplayer_${this.version}_sa${this.debug ? "_debug" : ""}.exe`;
|
||||
|
||||
Reference in New Issue
Block a user