mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Extensions: Implemented ::initialize
This commit is contained in:
parent
bdc2a8d974
commit
918573b694
2 changed files with 14 additions and 2 deletions
|
@ -26,11 +26,23 @@
|
|||
|
||||
#include <cmake.h>
|
||||
#include <Extensions.h>
|
||||
#include <FS.h>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Extensions::initialize ()
|
||||
void Extensions::initialize (const std::string& location)
|
||||
{
|
||||
// Scan extension directory.
|
||||
Directory d (location);
|
||||
if (d.is_directory () &&
|
||||
d.readable ())
|
||||
{
|
||||
_scripts = d.list ();
|
||||
std::sort (_scripts.begin (), _scripts.end ());
|
||||
}
|
||||
else
|
||||
throw std::string ("Extension directory not readable: ") + d._data;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue