Browse Source

cli: rename config file on Windows to "config"

but keep "streamlinkrc" as secondary file for backwards compatiblity
pull/3784/head
bastimeyer 5 months ago
committed by Forrest
parent
commit
b1c3aa14e8
  1. 6
      docs/cli.rst
  2. 12
      script/makeinstaller.sh
  3. 1
      src/streamlink_cli/constants.py
  4. 0
      win32/config

6
docs/cli.rst

@ -97,7 +97,8 @@ Platform Location
================= ====================================================
Unix-like (POSIX) - ``${XDG_CONFIG_HOME:-${HOME}/.config}/streamlink/config``
- ``${HOME}/.streamlinkrc``
Windows - ``%APPDATA%\streamlink\streamlinkrc``
Windows - ``%APPDATA%\streamlink\config``
- ``%APPDATA%\streamlink\streamlinkrc``
================= ====================================================
You can also specify the location yourself using the :option:`--config` option.
@ -160,7 +161,8 @@ Platform Location
================= ====================================================
Unix-like (POSIX) - ``${XDG_CONFIG_HOME:-${HOME}/.config}/streamlink/config.pluginname``
- ``${HOME}/.streamlinkrc.pluginname``
Windows - ``%APPDATA%\streamlink\streamlinkrc.pluginname``
Windows - ``%APPDATA%\streamlink\config.pluginname``
- ``%APPDATA%\streamlink\streamlinkrc.pluginname``
================= ====================================================
Have a look at the :ref:`list of plugins <plugin_matrix:Plugins>`, or

12
script/makeinstaller.sh

@ -169,7 +169,7 @@ cat > "${build_dir}/installer_tmpl.nsi" <<EOF
Function EditConfig
SetShellVarContext current
Exec '"\$WINDIR\notepad.exe" "\$APPDATA\streamlink\streamlinkrc"'
Exec '"\$WINDIR\notepad.exe" "\$APPDATA\streamlink\config"'
SetShellVarContext all
FunctionEnd
@ -202,7 +202,7 @@ SubSection /e "Bundled tools" bundled
SetOutPath "\$INSTDIR\rtmpdump"
File /r "${files_dir}\rtmpdump\*.*"
SetShellVarContext current
\${ConfigWrite} "\$APPDATA\streamlink\streamlinkrc" "rtmpdump=" "\$INSTDIR\rtmpdump\rtmpdump.exe" \$R0
\${ConfigWrite} "\$APPDATA\streamlink\config" "rtmpdump=" "\$INSTDIR\rtmpdump\rtmpdump.exe" \$R0
SetShellVarContext all
SetOutPath -
SectionEnd
@ -211,7 +211,7 @@ SubSection /e "Bundled tools" bundled
SetOutPath "\$INSTDIR\ffmpeg"
File /r "${files_dir}\ffmpeg\*.*"
SetShellVarContext current
\${ConfigWrite} "\$APPDATA\streamlink\streamlinkrc" "ffmpeg-ffmpeg=" "\$INSTDIR\ffmpeg\ffmpeg.exe" \$R0
\${ConfigWrite} "\$APPDATA\streamlink\config" "ffmpeg-ffmpeg=" "\$INSTDIR\ffmpeg\ffmpeg.exe" \$R0
SetShellVarContext all
SetOutPath -
SectionEnd
@ -224,7 +224,7 @@ SubSectionEnd
SetShellVarContext current # install the config file for the current user
SetOverwrite off # config file we don't want to overwrite
SetOutPath \$APPDATA\streamlink
File /r "${files_dir}\streamlinkrc"
File /r "${files_dir}\config"
SetOverwrite ifnewer
SetOutPath -
SetShellVarContext all
@ -281,9 +281,9 @@ StrCmp \$0 \${ffmpeg} "" +2
[% endblock %]
EOF
# copy the streamlinkrc file to the build dir, we cannot use the Include.files property in the config file
# copy the config file to the build dir, we cannot use the Include.files property in the config file
# because those files will always overwrite, and for a config file we do not want to overwrite
cp "${ROOT}/win32/streamlinkrc" "${files_dir}/streamlinkrc"
cp "${ROOT}/win32/config" "${files_dir}/config"
# make sure the license has a file extension
cp "${ROOT}/LICENSE" "${files_dir}/LICENSE.txt"

1
src/streamlink_cli/constants.py

@ -30,6 +30,7 @@ LOG_DIR: Path
if is_win32:
APPDATA = Path(os.environ.get("APPDATA") or Path.home() / "AppData")
CONFIG_FILES = [
APPDATA / "streamlink" / "config",
APPDATA / "streamlink" / "streamlinkrc"
]
PLUGIN_DIRS = [

0
win32/streamlinkrc → win32/config

Loading…
Cancel
Save