@ -25,9 +25,9 @@ int app::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine> &cmd) {
if ( boost : : filesystem : : exists ( p ) ) {
p = boost : : filesystem : : canonical ( p ) ;
if ( boost : : filesystem : : is_regular_file ( p ) )
files . emplace_back ( p . string ( ) ) ;
files . emplace_back ( p ) ;
else if ( boost : : filesystem : : is_directory ( p ) )
directories . emplace_back ( p . string ( ) ) ;
directories . emplace_back ( p ) ;
}
else
std : : cerr < < " Path " < < p < < " does not exist. " < < std : : endl ;
@ -49,16 +49,17 @@ void app::on_activate() {
}
else {
std : : string files_in_directory ;
for ( size_t c = 0 ; c < files . size ( ) ; c + + ) {
if ( files [ c ] . substr ( 0 , directory . size ( ) ) = = directory ) {
files_in_directory + = " " + files [ c ] ;
files . erase ( files . begin ( ) + c ) ;
c - - ;
for ( auto it = files . begin ( ) ; it ! = files . end ( ) ; ) {
if ( it - > generic_string ( ) . substr ( 0 , directory . generic_string ( ) . size ( ) + 1 ) = = directory . generic_string ( ) + ' / ' ) {
files_in_directory + = " " + it - > string ( ) ;
it = files . erase ( it ) ;
}
else
it + + ;
}
std : : thread another_juci_app ( [ this , directory , files_in_directory ] ( ) {
Singleton : : terminal ( ) - > async_print ( " Executing: juci " + directory + files_in_directory ) ;
Singleton : : terminal ( ) - > execute ( " juci " + directory + files_in_directory , " " ) ; //TODO: do not open pipes here, doing this after Juci compiles on Windows
Singleton : : terminal ( ) - > async_print ( " Executing: juci " + directory . string ( ) + files_in_directory ) ;
Singleton : : terminal ( ) - > execute ( " juci " + directory . string ( ) + files_in_directory , " " ) ; //TODO: do not open pipes here, doing this after Juci compiles on Windows
} ) ;
another_juci_app . detach ( ) ;
}