Pass the project path in to the installation script

This commit is contained in:
Manuel Thalmann 2024-07-26 14:29:45 +02:00
parent b1276083fb
commit eea07cbe00
2 changed files with 23 additions and 12 deletions

View file

@ -9,7 +9,13 @@ begin
exit 1
end
function mkWinPath
sed "s/\//\\\\/g"
end
set -l setupLabel "winiso-valhalla"
set -l projectPath "PortValhalla"
set -l localProjectPath "sources/\$OEM\$/\$1/$projectPath"
set -l buildDir "$(status dirname)/build"
set -l cacheDir ~/.cache/winiso-valhalla
set -l isoFile "$buildDir/winiso-valhalla.iso"
@ -66,7 +72,7 @@ begin
set -l url "$entry[2]"
set -l type "$entry[3]"
set -l dir "$entry[4]"
set -l winPath "X:\\$(echo "$name" | sed "s/\//\\\\/g")"
set -l winPath "X:\\$(echo "$name" | mkWinPath)"
set -l file "$cacheDir/$name.$type"
set -l target "$winpeOverlay/$name"
@ -119,13 +125,15 @@ begin
end
printf %s\n \
"@echo off" \
"echo Loading Drivers..." (
"@echo off" (
string join ";" \
"set PATH=%PATH%" \
$path \
"$git[4]\\bin"
) \
"set LOCAL_PROJECT_PATH=$(echo "$localProjectPath" | mkWinPath)" \
"set REMOTE_PROJECT_PATH=$(echo "$projectPath" | mkWinPath)" \
"echo Loading Drivers..." \
'pwsh -file "X:\Scripts\Drivers.ps1"' \
"echo Configuring Network..." \
"wpeinit" \
@ -159,13 +167,18 @@ begin
end
begin
set -l sourceDir "$winOverlay/sources"
set -l projectPath "$sourceDir/\$OEM\$/\$1/PortValhalla"
chmod u+w "$sourceDir"
set -l projectPath "$winOverlay/$localProjectPath"
set -l rootDir "$projectPath"
while [ ! -d "$rootDir" ]
set rootDir (dirname "$rootDir")
end
chmod u+w "$rootDir"
mkdir -p "$projectPath"
source "$dir/../scripts/copy-repo.fish" "$projectPath"
rm -rf "$projectPath/archiso"
chmod -R u-w "$sourceDir"
chmod -R u-w "$rootDir"
end
sudo mount --mkdir -t overlay overlay -o lowerdir="$winOverlay":"$winpePath":"$winPath",upperdir="$upperDir",workdir="$workDir" "$valhallaPath"

View file

@ -1,5 +1,3 @@
$null = $env:WIN_COMPUTER_NAME;
$null = $env:SETUP_SCRIPT_NAME;
git clone https://git.nuth.ch/manuth/PortValhalla.git;
Set-Location PortValhalla;
$drives = & wmic volume get "DriveLetter,Label";
$drive = $($($drives | Select-String -Pattern "winiso-valhalla") -split "\s+")[0];
Set-Location (Join-Path $drive $env:LOCAL_PROJECT_PATH)