cellar is now capable of finding your steam libraries
This commit is contained in:
		@@ -2,3 +2,4 @@ core
 | 
			
		||||
config
 | 
			
		||||
bottles
 | 
			
		||||
launch
 | 
			
		||||
steam
 | 
			
		||||
							
								
								
									
										1
									
								
								src/steam/commands.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/steam/commands.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
steamtest test_command Test Steam related thing.
 | 
			
		||||
@@ -20,4 +20,14 @@ std::vector<std::string> cellar::steam::find_steam_libraries() {
 | 
			
		||||
 | 
			
		||||
    std::ifstream fd_steam_library_config(str_steam_library_config);
 | 
			
		||||
    auto hnd_steam_library_config = vdf::read(fd_steam_library_config);
 | 
			
		||||
 | 
			
		||||
    std::vector<std::string> result;
 | 
			
		||||
 | 
			
		||||
    for (auto hnd_library_def : hnd_steam_library_config.childs) {
 | 
			
		||||
        std::string str_index = hnd_library_def.first;
 | 
			
		||||
        auto hnd_library = hnd_library_def.second;
 | 
			
		||||
        result.push_back(hnd_library->attribs["path"]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return result;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								src/steam/test_command.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/steam/test_command.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
#include <iostream>
 | 
			
		||||
 | 
			
		||||
#include "output.hpp"
 | 
			
		||||
#include "steam.hpp"
 | 
			
		||||
#include "internal/steam.hpp"
 | 
			
		||||
 | 
			
		||||
void cellar::steam::test_command(int argc, std::vector<std::string> argv) {
 | 
			
		||||
    for (std::string str_path : cellar::steam::find_steam_libraries()) {
 | 
			
		||||
        output::statement(str_path);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user