summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'scripting')
-rw-r--r--scripting/engine.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripting/engine.cpp b/scripting/engine.cpp
index a20a48196af..5c53cdd1f65 100644
--- a/scripting/engine.cpp
+++ b/scripting/engine.cpp
@@ -58,24 +58,25 @@ namespace mongo {
uassert( "compile failed" , func );
return invoke( func , args, timeoutMs );
}
-
+
bool Scope::execFile( const string& filename , bool printResult , bool reportError , bool assertOnError, int timeoutMs ){
path p( filename );
- if ( is_directory( p ) ){
- cerr << "can't read directory [" << filename << "]" << endl;
+
+ if ( ! exists( p ) ){
+ cerr << "file [" << filename << "] doesn't exist" << endl;
if ( assertOnError )
assert( 0 );
return false;
}
-
- if ( ! exists( p ) ){
- cerr << "file [" << filename << "] doesn't exist" << endl;
+
+ if ( is_directory( p ) ){
+ cerr << "can't read directory [" << filename << "]" << endl;
if ( assertOnError )
assert( 0 );
return false;
}
-
+
File f;
f.open( filename.c_str() );