mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
Spreadsheet: Move runtime.js file from /res to /usr/share
This commit is contained in:
committed by
Tim Schumacher
parent
72d1563206
commit
8fd0e1294c
@@ -10,9 +10,9 @@
|
||||
TEST_ROOT("Userland/Applications/Spreadsheet/Tests");
|
||||
|
||||
#ifdef AK_OS_SERENITY
|
||||
static constexpr auto s_spreadsheet_runtime_path = "/res/js/Spreadsheet/runtime.js"sv;
|
||||
static constexpr auto s_spreadsheet_runtime_path = "/usr/share/Spreadsheet/runtime.js"sv;
|
||||
#else
|
||||
static constexpr auto s_spreadsheet_runtime_path = "../../../../Base/res/js/Spreadsheet/runtime.js"sv;
|
||||
static constexpr auto s_spreadsheet_runtime_path = "../../../../Base/usr/share/Spreadsheet/runtime.js"sv;
|
||||
#endif
|
||||
|
||||
TESTJS_RUN_FILE_FUNCTION(ByteString const&, JS::Realm& realm, JS::ExecutionContext& global_execution_context)
|
||||
|
||||
@@ -52,7 +52,7 @@ Sheet::Sheet(Workbook& workbook)
|
||||
global_object().define_direct_property("thisSheet", &global_object(), JS::default_attributes); // Self-reference is unfortunate, but required.
|
||||
|
||||
// Sadly, these have to be evaluated once per sheet.
|
||||
constexpr auto runtime_file_path = "/res/js/Spreadsheet/runtime.js"sv;
|
||||
constexpr auto runtime_file_path = "/usr/share/Spreadsheet/runtime.js"sv;
|
||||
auto file_or_error = Core::File::open(runtime_file_path, Core::File::OpenMode::Read);
|
||||
if (!file_or_error.is_error()) {
|
||||
auto buffer = file_or_error.value()->read_until_eof().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
@@ -48,6 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw"));
|
||||
TRY(Core::System::unveil("/etc", "r"));
|
||||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil("/usr/share/Spreadsheet", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-spreadsheet"sv);
|
||||
|
||||
Reference in New Issue
Block a user