mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 13:03:43 +00:00
setup agent runtime requirements (#7)
This commit is contained in:
parent
5d97c33d7e
commit
e75b3f98a6
17 changed files with 424 additions and 28 deletions
39
scripts/sync-clone
Executable file
39
scripts/sync-clone
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "usage: $0 /absolute/path/to/clone" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
clone_dir="$1"
|
||||
|
||||
if [[ "$clone_dir" != /* ]]; then
|
||||
echo "clone path must be absolute: $clone_dir" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$clone_dir/.git" ]]; then
|
||||
git clone --local --no-hardlinks "$repo_root" "$clone_dir"
|
||||
fi
|
||||
|
||||
find "$clone_dir" -mindepth 1 -maxdepth 1 \
|
||||
! -name .git \
|
||||
! -name .env.agent \
|
||||
-exec rm -rf {} +
|
||||
|
||||
tar \
|
||||
--exclude=.git \
|
||||
--exclude=.state \
|
||||
--exclude=.turbo \
|
||||
--exclude=node_modules \
|
||||
--exclude=dist \
|
||||
--exclude='apps/web/.next' \
|
||||
-C "$repo_root" \
|
||||
-cf - \
|
||||
. | tar -C "$clone_dir" -xf -
|
||||
|
||||
echo "Synced working tree into $clone_dir"
|
||||
Loading…
Add table
Add a link
Reference in a new issue