Skip to content

Commit

Permalink
cli: rename config file on Windows to "config"
Browse files Browse the repository at this point in the history
but keep "streamlinkrc" as secondary file for backwards compatiblity
  • Loading branch information
bastimeyer authored and gravyboat committed Jun 6, 2021
1 parent 4b5d448 commit b1c3aa1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions script/makeinstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/streamlink_cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
if is_win32:
APPDATA = Path(os.environ.get("APPDATA") or Path.home() / "AppData")
CONFIG_FILES = [
APPDATA / "streamlink" / "config",
APPDATA / "streamlink" / "streamlinkrc"
]
PLUGIN_DIRS = [
Expand Down
File renamed without changes.

0 comments on commit b1c3aa1

Please sign in to comment.