Skip to content

Commit

Permalink
model/を考慮してダウンロードする (VOICEVOX#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip authored Jan 20, 2023
1 parent dc81c39 commit b420f94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/downloads/download.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ Function Download-and-Extract($Target,$Url,$ExtractDir,$ArchiveFormat){
if ([string]::IsNullOrEmpty($_.Name)){
return
}
$NewFile=[IO.FileInfo]([IO.Path]::Combine($ExtractDir,$_.Name))
$FixedName=$_.FullName.Replace('\', '/')
$NewFile=[IO.FileInfo]([IO.Path]::Combine($ExtractDir,$FixedName.SubString($FixedName.IndexOf('/') + 1)))
$NewFile.Directory.Create()
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_,$NewFile)
}
Expand Down
5 changes: 4 additions & 1 deletion scripts/downloads/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ download_and_extract(){
curl -sSLfo "$tmp_path" "$url"
echo "${target}をダウンロード完了,${archive_format}形式で${extract_dir}に解凍します..."
if [ "$archive_format" = "zip" ];then
unzip -j "$tmp_path" -d "$extract_dir"
top_dir=$(unzip -Z1 "$tmp_path" | head -n 1)
unzip "$tmp_path" -d "$extract_dir"
mv "$extract_dir/$top_dir"/* "$extract_dir"
rmdir "$extract_dir/$top_dir"
elif [ "$archive_format" = "tar.gz" ];then
mkdir -p "$extract_dir"
tar --strip-components 1 -xvzf "$tmp_path" -C "$extract_dir"
Expand Down

0 comments on commit b420f94

Please sign in to comment.