mirror of
https://github.com/black7375/Firefox-UI-Fix.git
synced 2025-12-06 02:30:54 -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 = ""
|
$customMethod = ""
|
||||||
$customReset = $false
|
$customReset = $false
|
||||||
$customAppend = $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() {
|
function Apply-CustomFile() {
|
||||||
Param (
|
Param (
|
||||||
[Parameter(Mandatory=$true, Position=0)]
|
[Parameter(Mandatory=$true, Position=0)]
|
||||||
|
|
@ -698,36 +731,7 @@ function Apply-CustomFile() {
|
||||||
$global:customFileApplied = $true
|
$global:customFileApplied = $true
|
||||||
|
|
||||||
if ( "${customMethod}" -eq "" ) {
|
if ( "${customMethod}" -eq "" ) {
|
||||||
$local:menuAppend="Append - Maintain changes in existing files and apply custom"
|
Set-CustomMethod
|
||||||
$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}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( "${customReset}" -eq $true ) {
|
if ( "${customReset}" -eq $true ) {
|
||||||
|
|
|
||||||
66
install.sh
66
install.sh
|
|
@ -657,10 +657,43 @@ copy_custom_files() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
customFileApplied=""
|
|
||||||
customMethod=""
|
customMethod=""
|
||||||
customReset=""
|
customReset=""
|
||||||
customAppend=""
|
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() {
|
apply_custom_file() {
|
||||||
local gitDir=$1
|
local gitDir=$1
|
||||||
local targetFile=$2
|
local targetFile=$2
|
||||||
|
|
@ -671,36 +704,7 @@ apply_custom_file() {
|
||||||
customFileApplied="true"
|
customFileApplied="true"
|
||||||
|
|
||||||
if [ -z "${customMethod}" ]; then
|
if [ -z "${customMethod}" ]; then
|
||||||
local menuAppend="Append - Maintain changes in existing files and apply custom"
|
set_custom_method
|
||||||
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}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${customReset}" == "true" ]; then
|
if [ "${customReset}" == "true" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue