mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
Update main.cpp
This commit is contained in:
parent
86a290e6c4
commit
0b2d54f88d
@ -66,14 +66,15 @@ int main(int argc, char** argv){
|
||||
filepath = std::filesystem::absolute(filepath);
|
||||
if(!std::filesystem::exists(filepath)){
|
||||
std::cerr << "File not found: " << argv_1 << std::endl;
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
std::ifstream file(filepath);
|
||||
if(!file.is_open()){
|
||||
std::cerr << "Failed to open file: " << argv_1 << std::endl;
|
||||
return 1;
|
||||
return 3;
|
||||
}
|
||||
std::string src((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
||||
file.close();
|
||||
|
||||
// set parent path as cwd
|
||||
std::filesystem::current_path(filepath.parent_path());
|
||||
|
Loading…
x
Reference in New Issue
Block a user