Files
pick/test.toml
2025-05-04 10:09:41 -07:00

60 lines
1.4 KiB
TOML

# All paths are relative to workdir.
# Workdir is this file's parent by default.
# If workdir is relative, it is relative to this file's parent.
[config]
work_dir = "./music"
# follow_links: if true, follow symlinks (default false)
# dirs: if true, act on directories (default false)
# files: if true, act on regular files (default true)
# links: if true, act on symlinks (default false. throw an error if this is provided with follow_links)
[tool.bash]
script.test = """
mkdir -p "$(dirname "../out/${PICK_RELATIVE}")"
filename="${PICK_RELATIVE%.*}"
ffmpeg \
-i "${PICK_FILE}" \
-map_metadata 0 \
-id3v2_version 3 \
-b:a 192k \
-loglevel error \
-hide_banner -n \
"../out/${filename}.mp3"
"""
script.ogg = """
mkdir -p "$(dirname "../out/${PICK_RELATIVE}")"
filename="${PICK_RELATIVE%.*}"
ffmpeg \
-i "${PICK_FILE}" \
-c:v libtheora \
-q:v 10 \
-c:a libopus \
-b:a 192k \
-loglevel error \
-hide_banner -n \
"../out/${filename}.ogg"
"""
# The first rule to match a path is run.
# Paths are checked relative to source.
# "/source/path/to/file.gz" becomes "path/to/file.gz"
#
# a "path segment" is a single file or directory.
#
# * matches exactly one path segment. In regex, this is [^/]+
# ** matches zero or more path segments. In regex, this is ([^/]+)*
#
# All rules are matched against the FULL PATH of files.
# Directories are ignored.
[[rules]]
"**" = "test"
[[rules]]
"**" = ""