diff --git a/scripts/configure.sh b/scripts/configure.sh new file mode 100755 index 0000000..a83e026 --- /dev/null +++ b/scripts/configure.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +set -e + +__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +echo "Install deps..." +npm i > /dev/null 2>&1 +npm run prepare > /dev/null 2>&1 + +echo "Configuring git hooks" +cp "${__dir}/src/pre-commit.sh" .git/hooks/pre-commit +echo "Repo correctly configured" \ No newline at end of file diff --git a/scripts/src/pre-commit.sh b/scripts/src/pre-commit.sh new file mode 100644 index 0000000..6b608c2 --- /dev/null +++ b/scripts/src/pre-commit.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +set -e + +npm run prepare +npm run check +npm run format +npm run lint diff --git a/src/lib/server/ytdlp.ts b/src/lib/server/ytdlp.ts index 99ca02b..48275aa 100644 --- a/src/lib/server/ytdlp.ts +++ b/src/lib/server/ytdlp.ts @@ -1,6 +1,7 @@ import { create } from 'youtube-dl-exec'; -import { YTDLP_PATH } from '$env/static/private'; +import { env } from '$env/dynamic/private'; import { spawn } from 'node:child_process'; +const YTDLP_PATH: string = env.YTDLP_PATH as string export const ytdl = create(YTDLP_PATH);