Skip to content

Commit

Permalink
feat: refactor directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoless committed Dec 24, 2024
1 parent 4c92404 commit 74a09e1
Show file tree
Hide file tree
Showing 315 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions agents/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ ten_packages/system/agora_rtc_sdk
ten_packages/system/azure_speech_sdk
ten_packages/system/nlohmann_json
ten_packages/system/ten_runtime*
ten_packages/extension/*
!ten_pacakges/extension/
!ten_packages/extension/.gitkeep
.ten
agoradns.dat
agorareport.dat
Expand Down
32 changes: 32 additions & 0 deletions agents/scripts/install_deps_and_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,34 @@ extract_dependencies() {
jq -r '.dependencies[] | select(.type=="system") | .name' "$app_dir/manifest.json" >"$systems_file"
}

create_symbolic_links() {
local app_dir=$1
local extensions_file=$2

# Clear all symbolic links in the ten_packages/extension folder
echo "Clearing all symbolic links in $app_dir/ten_packages/extension/..."
find "$app_dir/ten_packages/extension" -type l -exec rm -f {} \;

if [[ -f "$extensions_file" ]]; then
while IFS= read -r extension; do
local src_dir="$app_dir/ten_packages/src/$extension"
local dest_dir="$app_dir/ten_packages/extension/$extension"

if [[ ! -d "$src_dir" ]]; then
echo "WARNING: Source directory $src_dir does not exist, skipping symbolic link creation."
continue
fi

if [[ ! -d "$dest_dir" ]]; then
echo "Creating symbolic link from $src_dir to $dest_dir"
ln -s "$src_dir" "$dest_dir"
else
echo "Symbolic link already exists for $extension, skipping."
fi
done < "$extensions_file"
fi
}

main() {
APP_HOME=$(
cd $(dirname $0)/..
Expand Down Expand Up @@ -160,6 +188,10 @@ main() {
echo "extracting dependencies..."
extract_dependencies "$APP_HOME" "$EXTENSIONS_FILE" "$SYSTEMS_FILE"

# Create symbolic links for extensions
echo "creating symbolic links for extensions..."
create_symbolic_links "$APP_HOME" "$EXTENSIONS_FILE"

# Install all dependencies specified in manifest.json.
echo "install dependencies..."
tman install
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 74a09e1

Please sign in to comment.