diff --git a/src/d8.cc b/src/d8.cc index c4bc8b554f..109535e35a 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -2932,6 +2932,25 @@ bool Shell::SetOptions(int argc, char* argv[]) { return true; } +namespace { + +void SeasonalGreetings() { + if (Shell::script_executed()) return; + // clang-format off + printf( + " .-\"\"-. \n" + " /,..___\\ __ __ ____ _ _ _ \n" + "() {_____} | \\/ | ___ _ __ _ __ _ _ / ___| |__ _ __(_)___| |_ _ __ ___ __ _ ___ \n" + " (/-@-@-\\) | |\\/| |/ _ \\ '__| '__| | | | | | | '_ \\| '__| / __| __| '_ ` _ \\ / _` / __| \n" + " {`-=^=-'} | | | | __/ | | | | |_| | | |___| | | | | | \\__ \\ |_| | | | | | (_| \\__ \\ \n" + " { `-' } |_| |_|\\___|_| |_| \\__, | \\____|_| |_|_| |_|___/\\__|_| |_| |_|\\__,_|___/ \n" + " { } |___/ \n" + " `---' \n"); + // clang-format on +} + +} // namespace + int Shell::RunMain(Isolate* isolate, int argc, char* argv[], bool last_run) { for (int i = 1; i < options.num_isolates; ++i) { options.isolate_sources[i].StartExecuteInThread(); @@ -2953,6 +2972,7 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[], bool last_run) { InspectorClient inspector_client(context, options.enable_inspector); PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate)); options.isolate_sources[0].Execute(isolate); + SeasonalGreetings(); CompleteMessageLoop(isolate); } if (!use_existing_context) { diff --git a/src/d8.h b/src/d8.h index 68b3aa27b3..bdbd0b7613 100644 --- a/src/d8.h +++ b/src/d8.h @@ -534,6 +534,7 @@ class Shell : public i::AllStatic { static char* ReadCharsFromTcpPort(const char* name, int* size_out); static void set_script_executed() { script_executed_.store(true); } + static bool script_executed() { return script_executed_.load(); } static bool use_interactive_shell() { return (options.interactive_shell || !script_executed_.load()) && !options.test_shell;