mirror of
https://github.com/black7375/Firefox-UI-Fix.git
synced 2025-12-05 18:20:44 -08:00
Clean: Install - Separated set custom method
This commit is contained in:
parent
ac51fa2753
commit
352616c87d
2 changed files with 70 additions and 62 deletions
66
install.ps1
66
install.ps1
|
|
@ -678,10 +678,43 @@ function Copy-CustomFiles() {
|
|||
}
|
||||
}
|
||||
|
||||
$customFileApplied = $false
|
||||
$customMethod = ""
|
||||
$customReset = $false
|
||||
$customAppend = $false
|
||||
function Set-CustomMethod() {
|
||||
$local:menuAppend="Append - Maintain changes in existing files and apply custom"
|
||||
$local:menuOverwrite="Overwrite - After initializing the change, apply only custom"
|
||||
$local:menuNone="None - Maintain changes in existing files"
|
||||
$local:menuReset="Reset- Reset to pure lepton theme without custom"
|
||||
|
||||
Write-Host "Select custom method"
|
||||
while ( "${customMethod}" -eq "" ) {
|
||||
$local:applyMethod = Menu @("${menuAppend}", "${menuOverwrite}", "${menuNone}", "${menuReset}")
|
||||
switch ( $applyMethod ) {
|
||||
"${menuAppend}" {
|
||||
$global:customMethod = "Append"
|
||||
$global:customAppend = $true
|
||||
}
|
||||
"${menuOverwrite}" {
|
||||
$global:customMethod = "Overwrite"
|
||||
$global:customReset = $true
|
||||
$global:customAppend = $true
|
||||
}
|
||||
"${menuNone}" {
|
||||
$global:customMethod = "None"
|
||||
}
|
||||
"${menuReset}" {
|
||||
$global:customMethod = "Reset"
|
||||
$global:customReset = $true
|
||||
}
|
||||
default { Write-Host "Invalid option, reselect please." }
|
||||
}
|
||||
}
|
||||
|
||||
Lepton-OKMessage "Selected ${customMethod}"
|
||||
}
|
||||
|
||||
$customFileApplied = $false
|
||||
function Apply-CustomFile() {
|
||||
Param (
|
||||
[Parameter(Mandatory=$true, Position=0)]
|
||||
|
|
@ -698,36 +731,7 @@ function Apply-CustomFile() {
|
|||
$global:customFileApplied = $true
|
||||
|
||||
if ( "${customMethod}" -eq "" ) {
|
||||
$local:menuAppend="Append - Maintain changes in existing files and apply custom"
|
||||
$local:menuOverwrite="Overwrite - After initializing the change, apply only custom"
|
||||
$local:menuNone="None - Maintain changes in existing files"
|
||||
$local:menuReset="Reset- Reset to pure lepton theme without custom"
|
||||
|
||||
Write-Host "Select custom method"
|
||||
while ( "${customMethod}" -eq "" ) {
|
||||
$local:applyMethod = Menu @("${menuAppend}", "${menuOverwrite}", "${menuNone}", "${menuReset}")
|
||||
switch ( $applyMethod ) {
|
||||
"${menuAppend}" {
|
||||
$global:customMethod = "Append"
|
||||
$global:customAppend = $true
|
||||
}
|
||||
"${menuOverwrite}" {
|
||||
$global:customMethod = "Overwrite"
|
||||
$global:customReset = $true
|
||||
$global:customAppend = $true
|
||||
}
|
||||
"${menuNone}" {
|
||||
$global:customMethod = "None"
|
||||
}
|
||||
"${menuReset}" {
|
||||
$global:customMethod = "Reset"
|
||||
$global:customReset = $true
|
||||
}
|
||||
default { Write-Host "Invalid option, reselect please." }
|
||||
}
|
||||
}
|
||||
|
||||
Lepton-OKMessage "Selected ${customMethod}"
|
||||
Set-CustomMethod
|
||||
}
|
||||
|
||||
if ( "${customReset}" -eq $true ) {
|
||||
|
|
|
|||
66
install.sh
66
install.sh
|
|
@ -657,10 +657,43 @@ copy_custom_files() {
|
|||
fi
|
||||
}
|
||||
|
||||
customFileApplied=""
|
||||
customMethod=""
|
||||
customReset=""
|
||||
customAppend=""
|
||||
set_custom_method() {
|
||||
local menuAppend="Append - Maintain changes in existing files and apply custom"
|
||||
local menuOverwrite="Overwrite - After initializing the change, apply only custom"
|
||||
local menuNone="None - Maintain changes in existing files"
|
||||
local menuReset="Reset- Reset to pure lepton theme without custom"
|
||||
|
||||
echo "Select custom method"
|
||||
select applyMethod in "${menuAppend}" "${menuOverwrite}" "${menuNone}" "${menuReset}"; do
|
||||
case "${applyMethod}" in
|
||||
"${menuAppend}")
|
||||
customMethod="Append"
|
||||
customAppend="true"
|
||||
break;;
|
||||
"${menuOverwrite}")
|
||||
customMethod="Overwrite"
|
||||
customReset="true"
|
||||
customAppend="true"
|
||||
break;;
|
||||
"${menuNone}")
|
||||
customMethod="None"
|
||||
break;;
|
||||
"${menuReset}")
|
||||
customMethod="Reset"
|
||||
customReset="true"
|
||||
break;;
|
||||
*)
|
||||
echo "Invalid option, reselect please.";;
|
||||
esac
|
||||
done
|
||||
|
||||
lepton_ok_message "Selected ${customMethod}"
|
||||
}
|
||||
|
||||
customFileApplied=""
|
||||
apply_custom_file() {
|
||||
local gitDir=$1
|
||||
local targetFile=$2
|
||||
|
|
@ -671,36 +704,7 @@ apply_custom_file() {
|
|||
customFileApplied="true"
|
||||
|
||||
if [ -z "${customMethod}" ]; then
|
||||
local menuAppend="Append - Maintain changes in existing files and apply custom"
|
||||
local menuOverwrite="Overwrite - After initializing the change, apply only custom"
|
||||
local menuNone="None - Maintain changes in existing files"
|
||||
local menuReset="Reset- Reset to pure lepton theme without custom"
|
||||
|
||||
echo "Select custom method"
|
||||
select applyMethod in "${menuAppend}" "${menuOverwrite}" "${menuNone}" "${menuReset}"; do
|
||||
case "${applyMethod}" in
|
||||
"${menuAppend}")
|
||||
customMethod="Append"
|
||||
customAppend="true"
|
||||
break;;
|
||||
"${menuOverwrite}")
|
||||
customMethod="Overwrite"
|
||||
customReset="true"
|
||||
customAppend="true"
|
||||
break;;
|
||||
"${menuNone}")
|
||||
customMethod="None"
|
||||
break;;
|
||||
"${menuReset}")
|
||||
customMethod="Reset"
|
||||
customReset="true"
|
||||
break;;
|
||||
*)
|
||||
echo "Invalid option, reselect please.";;
|
||||
esac
|
||||
done
|
||||
|
||||
lepton_ok_message "Selected ${customMethod}"
|
||||
set_custom_method
|
||||
fi
|
||||
|
||||
if [ "${customReset}" == "true" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue