History

js: custom init: ignore ~~/.init.js with --no-config

The custom init script should be considered a configuration file, and as such it should be ignored when the user wants vanilla mpv - and now it is ignored with --no-config.

Avi Halachmi (:avih) committed 5 years ago

Commit f386fd71 parent a3ef4c62 files · +6 −1Browse files

Showing the changes to player/javascript (1 of 2 files). Show all

Unified · Split

player/javascript/defaults.js+4−1
@@ -773,5 +773,8 @@ g.mp_event_loop = function mp_event_loop() { · 772 unmodified lines
773 773
774// let the user extend us, e.g. by adding items to mp.module_paths774// let the user extend us, e.g. by adding items to mp.module_paths
775// (unlike e.g. read_file, file_info doesn't expand meta-paths)775// (unlike e.g. read_file, file_info doesn't expand meta-paths)
776if (mp.utils.file_info(mp.utils.get_user_path("~~/.init.js")))776if (mp.get_property_bool("config") && // --no-config disables custom init
777 mp.utils.file_info(mp.utils.get_user_path("~~/.init.js")))
778{
777 require("~~/.init");779 require("~~/.init");
780}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t