mirror of
https://github.com/Team-Neptune/DeepSea-Updater.git
synced 2024-11-26 22:00:33 +00:00
fixed typo. improved code. add a check for dirs.
This commit is contained in:
parent
9c35a3e401
commit
e29efce086
@ -98,21 +98,16 @@ namespace dsu
|
||||
dir = opendir(path.c_str());
|
||||
if(dir != NULL)
|
||||
{
|
||||
for (const auto & ft : fs::directory_iterator(path))
|
||||
for (auto ft : fs::directory_iterator(path))
|
||||
{
|
||||
string file;
|
||||
// Check if the fs in question is a dir (we don't want to list dirs, only files).
|
||||
if(ft.is_directory()) continue;
|
||||
|
||||
string ext = ft.path().extension().string();
|
||||
string fname = ft.path().filename().string();;
|
||||
string fextname = ext + fname;
|
||||
string fnamext = fname + ext;
|
||||
|
||||
if(ext == "")
|
||||
{
|
||||
file = fname;
|
||||
} else
|
||||
{
|
||||
file = fextname;
|
||||
}
|
||||
files.push_back(file);
|
||||
files.push_back(fnamext);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,11 +15,13 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <switch.h>
|
||||
#include <Swurl.hpp>
|
||||
|
||||
#include "FileManager.hpp"
|
||||
#include "AssetManager.hpp"
|
||||
#include "ConfigManager.hpp"
|
||||
#include "SceneDirector.hpp"
|
||||
@ -33,9 +35,15 @@ int main(int argc, char **argv)
|
||||
SessionManager::initialize();
|
||||
SessionManager::userAgent = string("DeepSea-updater/") + VERSION;
|
||||
|
||||
#ifdef DEBUG
|
||||
nxlinkStdio();
|
||||
#endif
|
||||
|
||||
vector<string> f = FileManager::getExistingFiles("sdmc:/switch");
|
||||
|
||||
for(auto i : f)
|
||||
{
|
||||
cout << i << "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
ConfigManager::initialize();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user