Skip to content

Commit

Permalink
chore: ignore third party invalid file
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwantaozi committed Nov 22, 2024
1 parent ed7bdda commit 6ec6713
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function build_platform() {
if [ -z "$platform" ]; then
vox_box::log::fatal "undefined platform to build"
fi

ignore_thirdparty_invalid_file

poetry build

Expand Down
3 changes: 2 additions & 1 deletion hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ source "${ROOT_DIR}/hack/lib/init.sh"

function download_deps() {
git submodule update --init --recursive
rm -rf "${ROOT_DIR}/vox_box/third_party/CosyVoice/third_party/Matcha-TTS/data"

ignore_thirdparty_invalid_file

pip install poetry==1.8.3 pre-commit==4.0.1
poetry install
Expand Down
11 changes: 11 additions & 0 deletions hack/lib/util.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"

function vox_box::util::sed() {
if ! sed -i "$@" >/dev/null 2>&1; then
Expand All @@ -25,3 +26,13 @@ function vox_box::util::is_darwin() {
function vox_box::util::is_linux() {
[[ "$(vox_box::util::get_os_name)" == "linux" ]]
}

function ignore_thirdparty_invalid_file() {
local data_file_dir="${ROOT_DIR}/vox_box/third_party/CosyVoice/third_party/Matcha-TTS"
pushd "${data_file_dir}" > /dev/null || exit
{
git update-index --assume-unchanged "data"
rm -rf "data"
}
popd > /dev/null || exit
}
23 changes: 23 additions & 0 deletions hack/lib/windows/util.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split-Path -Parent | Split-Path -Parent | Split-Path -Parent -Resolve

function Ignore-Thirdparty-InvalidFile {
$dataFileDir = Join-Path -Path $ROOT_DIR -ChildPath "vox_box/third_party/CosyVoice/third_party/Matcha-TTS"
if (-Not (Test-Path -Path $dataFileDir)) {
Write-Host "Directory $dataFileDir does not exist. Skipping."
return
}

Push-Location -Path $dataFileDir
try {
if (Test-Path -Path "data") {
git update-index --assume-unchanged "data"
Remove-Item -Recurse -Force "data"
}
else {
Write-Host "File 'data' does not exist. Skipping."
}
}
finally {
Pop-Location
}
}
1 change: 1 addition & 0 deletions hack/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function Build {
$distDir = Join-Path -Path $ROOT_DIR -ChildPath "dist"
Remove-Item -Path $distDir -Recurse -Force -ErrorAction SilentlyContinue

Ignore-Thirdparty-InvalidFile
poetry build
if ($LASTEXITCODE -ne 0) {
SpeechBox.Log.Fatal "failed to run poetry build."
Expand Down
3 changes: 2 additions & 1 deletion hack/windows/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ $ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split-

function Install-Dependency {
git submodule update --init --recursive
Remove-Item -Recurse -Force "$ROOT_DIR/vox_box/third_party/CosyVoice/third_party/Matcha-TTS/data"

Ignore-Thirdparty-InvalidFile

pip install poetry==1.8.3 pre-commit==4.0.1
if ($LASTEXITCODE -ne 0) {
Expand Down

0 comments on commit 6ec6713

Please sign in to comment.