mirror of
https://github.com/aaddrick/claude-desktop-debian.git
synced 2026-05-17 00:26:21 +03:00
Splits the 2124-line build.sh into a 318-line orchestrator plus
16 topical modules, grouped so CODEOWNERS can assign per-subsystem
reviewers:
scripts/_common.sh shared shell utilities
scripts/setup/ host detection, deps, download
scripts/patches/ regex patches on minified JS
_common.sh extract_electron_variable etc.
app-asar.sh wrapper injection
titlebar.sh
tray.sh menu handler + icon selection
quick-window.sh
claude-code.sh
cowork.sh cowork linux patching (largest)
scripts/staging/ post-patch file staging
build.sh now sources each module in dependency order and retains
only run_packaging, cleanup_build, print_next_steps, and main.
All globals stay at the top of build.sh and are read by sourced
modules; each module's header documents which globals it reads and
mutates (implicit-contract documentation).
This is a pure-move refactor. Function bodies were copied verbatim
— verified by byte-identical diff of the function set vs the
pre-split build.sh (34 functions, all present with identical bodies).
Note: .github/workflows/shellcheck.yml may benefit from a '-x' flag
so shellcheck follows the new '# shellcheck source=' directives, but
that CI tweak is left as a separate concern.
Co-Authored-By: Claude <claude@anthropic.com>
51 lines
1.1 KiB
Bash
51 lines
1.1 KiB
Bash
#===============================================================================
|
|
# Common shell utilities: logging, command checks, checksum verification.
|
|
#
|
|
# Sourced by: build.sh
|
|
# Sourced globals: (none)
|
|
# Modifies globals: (none)
|
|
#===============================================================================
|
|
|
|
check_command() {
|
|
if ! command -v "$1" &> /dev/null; then
|
|
echo "$1 not found"
|
|
return 1
|
|
else
|
|
echo "$1 found"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
section_header() {
|
|
echo -e "\033[1;36m--- $1 ---\033[0m"
|
|
}
|
|
|
|
section_footer() {
|
|
echo -e "\033[1;36m--- End $1 ---\033[0m"
|
|
}
|
|
|
|
verify_sha256() {
|
|
local file_path="$1"
|
|
local expected_hash="$2"
|
|
local label="${3:-file}"
|
|
|
|
if [[ -z $expected_hash ]]; then
|
|
echo "Warning: No SHA-256 hash for ${label}," \
|
|
'skipping verification' >&2
|
|
return 0
|
|
fi
|
|
|
|
echo "Verifying SHA-256 checksum for ${label}..."
|
|
local actual_hash _
|
|
read -r actual_hash _ < <(sha256sum "$file_path")
|
|
|
|
if [[ $actual_hash != "$expected_hash" ]]; then
|
|
echo "SHA-256 mismatch for ${label}!" >&2
|
|
echo " Expected: $expected_hash" >&2
|
|
echo " Actual: $actual_hash" >&2
|
|
return 1
|
|
fi
|
|
|
|
echo "SHA-256 verified: ${label}"
|
|
}
|