Streamline archive extraction
This commit is contained in:
parent
ab28605732
commit
15742f29e1
1 changed files with 23 additions and 40 deletions
63
deploy.fish
63
deploy.fish
|
@ -49,17 +49,35 @@ begin
|
|||
set -l url "$entry[2]"
|
||||
set -l type "$entry[3]"
|
||||
set -l dir "$entry[4]"
|
||||
set -l downloadPath "$cacheDir/$name.$type"
|
||||
set -l file "$cacheDir/$name.$type"
|
||||
set -l target "$winpeOverlay/$name"
|
||||
|
||||
set -a files \
|
||||
"$downloadPath" \
|
||||
"$file" \
|
||||
"$dir" \
|
||||
"$name"
|
||||
|
||||
mkdir -p (dirname "$downloadPath")
|
||||
mkdir -p (dirname "$file")
|
||||
|
||||
if [ ! -f "$downloadPath" ]
|
||||
curl -L "$url" -o "$downloadPath"
|
||||
if [ ! -f "$file" ]
|
||||
curl -L "$url" -o "$file"
|
||||
end
|
||||
|
||||
begin
|
||||
set -l tempDir (mktemp -d)
|
||||
|
||||
switch $type
|
||||
case zip
|
||||
unzip "$file" -d "$tempDir"
|
||||
case exe
|
||||
pushd "$tempDir" > /dev/null
|
||||
7z x "$file"
|
||||
popd > /dev/null
|
||||
end
|
||||
|
||||
mkdir -p (dirname "$target")
|
||||
cp -r "$tempDir/$dir" "$target"
|
||||
rm -rf "$tempDir"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -69,41 +87,6 @@ begin
|
|||
set -l pwsh $files[10..12]
|
||||
|
||||
cp -r "$dir/winfs"/* "$winpeOverlay"
|
||||
mkdir -p "$winpeOverlay/drivers"
|
||||
|
||||
begin
|
||||
set -l tempDir (mktemp -d)
|
||||
unzip "$intel[1]" -d "$tempDir"
|
||||
mkdir -p (dirname "$winpeOverlay/$intel[3]")
|
||||
cp -r "$tempDir/$intel[2]" "$winpeOverlay/$intel[3]"
|
||||
rm -rf "$tempDir"
|
||||
end
|
||||
|
||||
begin
|
||||
set -l tempDir (mktemp -d)
|
||||
unzip "$marvell[1]" -d "$tempDir"
|
||||
mkdir -p (dirname "$winpeOverlay/$marvell[3]")
|
||||
cp -r "$tempDir/$marvell[2]" "$winpeOverlay/$marvell[3]"
|
||||
rm -rf "$tempDir"
|
||||
end
|
||||
|
||||
begin
|
||||
set -l tempDir (mktemp -d)
|
||||
pushd "$tempDir" > /dev/null
|
||||
7z x "$git[1]"
|
||||
popd > /dev/null
|
||||
mkdir -p (dirname "$winpeOverlay/$git[3]")
|
||||
cp -r "$tempDir/$git[2]" "$winpeOverlay/$git[3]"
|
||||
rm -rf "$tempDir"
|
||||
end
|
||||
|
||||
begin
|
||||
set -l tempDir (mktemp -d)
|
||||
unzip "$pwsh[1]" -d "$tempDir"
|
||||
mkdir -p (dirname "$winpeOverlay/$pwsh[3]")
|
||||
cp -r "$tempDir/$pwsh[2]" "$winpeOverlay/$pwsh[3]"
|
||||
rm -rf "$tempDir"
|
||||
end
|
||||
|
||||
mkdir -p "$(dirname "$isoFile")"
|
||||
sudo mount --mkdir "$WIN11_IMAGE_PATH" "$winPath"
|
||||
|
|
Loading…
Reference in a new issue