Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated "bin/compile" to correctly pick up the FFMPEG_DOWNLOAD_URL env variable according to heroku docs #61

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ header() {
echo "-----> $*" || true
}

export_env_dir() {
env_dir=$1
acceptlist_regex=${2:-''}
denylist_regex=${3:-'^(PATH|GIT_DIR|CPATH|CPPATH|LD_PRELOAD|LIBRARY_PATH)$'}
if [ -d "$env_dir" ]; then
for e in $(ls $env_dir); do
echo "$e" | grep -E "$acceptlist_regex" | grep -qvE "$denylist_regex" &&
export "$e=$(cat $env_dir/$e)"
:
done
fi
}

output() {
while IFS= read -r LINE; do
# do not indent headers that are being piped through the output
Expand All @@ -20,9 +33,12 @@ output() {
header "Installing ffmpeg"

BUILD_DIR=${1:-}
ENV_DIR=${3:-}
VENDOR_DIR="vendor"
FFMPEG_ARCHIVE_NAME="ffmpeg.tar.xz"

export_env_dir $ENV_DIR

cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
Expand Down Expand Up @@ -56,4 +72,4 @@ PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:${HOME}/vendor/ffmpeg"' >> $PROFILE_PATH

echo "Installation successful" | output
echo "Installation successful" | output