Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Update garena test checks, again #439

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/path_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ function checkInstallPath(selected_path, done) {
} else {
const default_path = path.join(selected_path, 'lol.launcher.exe');
const new_launcher_path = path.join(selected_path, 'LeagueClient.exe');
const garena_check_one = path.join(selected_path, 'lolex.exe');
const garena_check_one = path.join(selected_path, 'League of Legends.exe');
const garena_check_two = glob.sync(path.join(selected_path, 'LoL*Launcher.exe'))[0];

if (fs.existsSync(new_launcher_path)) {
done(null, selected_path, 'Config/Champions/', path.basename(new_launcher_path));
} else if (fs.existsSync(default_path)) {
done(null, selected_path, 'Config/Champions/', path.basename(default_path));
} else if (fs.existsSync(garena_check_one)) {
done(null, selected_path, 'Game/Config/Champions/', path.basename(garena_check_one));
done(null, selected_path, 'Config/Champions/', path.basename(garena_check_one));
} else if (garena_check_two) {
let garena_version = path.basename(glob.sync(path.join(selected_path, 'GameData/Apps/*'))[0]);
done(null, selected_path, `GameData/Apps/${garena_version}/Game/Config/Champions/`, path.basename(garena_check_two));
Expand Down
6 changes: 3 additions & 3 deletions tests/path_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ describe('src/path_manager', () => {

it('should the correct path for garena check 1 installation', function(done) {
fs.mkdirsSync('./tmp/2/');
fs.writeFileSync('./tmp/2/lolex.exe', '123', 'utf8');
fs.writeFileSync('./tmp/2/League of Legends.exe', '123', 'utf8');
const test_path = path.resolve('./tmp/2/');
pathManager.checkInstallPath(test_path, function(err, selected_path, config_dir, executable) {
should.not.exist(err);
selected_path.should.equal(test_path);
config_dir.should.equal('Game/Config/Champions/');
executable.should.equal('lolex.exe');
config_dir.should.equal('Config/Champions/');
executable.should.equal('League of Legends.exe');
done();
});
});
Expand Down