mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
16 lines
479 B
PHP
16 lines
479 B
PHP
@php
|
|
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
|
@endphp
|
|
|
|
@if($extension === 'zip')
|
|
unzip -o {{ $path }} -d {{ $destination }}
|
|
@elseif($extension === 'tar'))
|
|
tar -xf {{ $path }} -C {{ $destination }}
|
|
@elseif(in_array($extension, ['gz', 'tar.gz']))
|
|
tar -xzf {{ $path }} -C {{ $destination }}
|
|
@elseif(in_array($extension, ['bz2', 'tar.bz2']))
|
|
tar -xjf {{ $path }} -C {{ $destination }}
|
|
@else
|
|
echo "Unsupported archive format: {{ $extension }}"
|
|
@endif
|