Skip to content

Commit

Permalink
tweaked mac run command and parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamYG committed Apr 25, 2019
1 parent 9bcc302 commit e27ca48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/classes/Campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@ export default class Campaign {
}
static getCampaignRunCommand = (campaign:ICampaign):string => {
console.group("getCampaignRunCommand");
const command = Config.getRunCommand();
const entryPoint = (campaign.entryPoint)?campaign.entryPoint:campaign.maps[0].destination;
const entryPointPath = path.join(Campaign.getCampaignsInstallDir(),entryPoint)
const command = Config.getRunCommand().replace("{map}",entryPointPath);
console.log("command", command)
console.groupEnd();
return command;
}
static getCampaignRunParams = (campaign:ICampaign):Array<string> => {
console.group("getCampaignRunParams");
const entryPoint = (campaign.entryPoint)?campaign.entryPoint:campaign.maps[0].destination;
const params = Config.getRunParams().map(e=>e.replace("{map}",path.join(Campaign.getCampaignsInstallDir(),entryPoint));)
const entryPointPath = path.join(Campaign.getCampaignsInstallDir(),entryPoint)
const params = Config.getRunParams().map(e=>e.replace("{map}",entryPointPath);)

console.log("params", params)
console.groupEnd();
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ export default class Config {

const commands:any = {
WINDOWS:path.join(baseDir?baseDir:Config.getInstallDir(),"Support64/" ,"SC2Switcher_x64.exe"),
MAC:"open {map}",
MAC:"open",
LINUX:"wine \"C:\\Program Files (x86)\\StarCraft II\\StarCraft II.exe\""
};
return Config.configFileExists()? (Config.loadFromDisk().runCommand):commands[currentPlatform];
}
static getRunParams():Array<string> {
const defaultParams:any = {
WINDOWS:'-run {map} -reloadcheck',
MAC:"-a \"sc2switcher\"",
MAC:"-a {map} \"sc2switcher\"",
LINUX:"-run {map} -reloadcheck"
};
const params = Config.configFileExists()&&Config.loadFromDisk().params? (Config.loadFromDisk().params):defaultParams[currentPlatform];
Expand Down

0 comments on commit e27ca48

Please sign in to comment.