Skip to content

Commit

Permalink
Don't load import files if cli extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Oct 4, 2024
1 parent 0c26f1a commit bb09656
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion standalone/gdre_main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func recovery( input_file:String,
print("Error: failed to set key!")
return

err = GDRESettings.load_pack(input_file)
err = GDRESettings.load_pack(input_file, extract_only)
if (err != OK):
print("Error: failed to open " + input_file)
return
Expand Down
9 changes: 6 additions & 3 deletions utility/gdre_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Error check_embedded(String &p_path) {
return OK;
}

Error GDRESettings::load_pack(const String &p_path) {
Error GDRESettings::load_pack(const String &p_path, bool _cmd_line_extract) {
if (is_pack_loaded()) {
return ERR_ALREADY_IN_USE;
}
Expand All @@ -453,7 +453,7 @@ Error GDRESettings::load_pack(const String &p_path) {
if (list.size() > 1) {
WARN_PRINT("Found multiple pck files in bundle, using first one!!!");
}
path = list[0];
return load_pack(list[0]);
}
}
}
Expand Down Expand Up @@ -485,7 +485,10 @@ Error GDRESettings::load_pack(const String &p_path) {
err = GDREPackedData::get_singleton()->add_pack(path, false, 0);
ERR_FAIL_COND_V_MSG(err, err, "FATAL ERROR: Can't open pack!");
ERR_FAIL_COND_V_MSG(!is_pack_loaded(), ERR_FILE_CANT_READ, "FATAL ERROR: loaded project pack, but didn't load files from it!");

if (_cmd_line_extract) {
// we don't want to load the imports and project config if we're just extracting.
return OK;
}
err = load_import_files();
ERR_FAIL_COND_V_MSG(err, ERR_FILE_CANT_READ, "FATAL ERROR: Could not load imported binary files!");
if (!has_valid_version()) {
Expand Down
2 changes: 1 addition & 1 deletion utility/gdre_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class GDRESettings : public Object {
static void _bind_methods();

public:
Error load_pack(const String &p_path);
Error load_pack(const String &p_path, bool cmd_line_extract = false);
Error unload_pack();
String get_gdre_resource_path() const;

Expand Down

0 comments on commit bb09656

Please sign in to comment.