Add configure script

This commit is contained in:
0d0 2025-02-14 19:35:55 +01:00
parent ae6b7b3a24
commit 88c5e9af48
3 changed files with 37 additions and 1 deletions

20
scripts/configure.sh Executable file
View file

@ -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"

15
scripts/src/pre-commit.sh Normal file
View file

@ -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

View file

@ -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);