Skip to content

Commit 72eff34

Browse files
authored
Merge pull request #23 from Emirhanblc/add-help-messages
Add help messages to scripts
2 parents 801a398 + 4fbd979 commit 72eff34

3 files changed

Lines changed: 355 additions & 59 deletions

File tree

scripts/build-iso.sh

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
2-
# CVH Linux ISO Build Script
3-
# Builds a bootable live ISO of CVH Linux
2+
# CodeVerse Linux ISO Build Script
3+
# Builds a bootable live ISO of CodeVerse Linux
4+
#
5+
# USAGE: ./build-iso.sh [OPTIONS]
6+
#
7+
# Run './build-iso.sh --help' for more detailed information.
48

59
set -euo pipefail
610

@@ -23,6 +27,32 @@ log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
2327
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
2428
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
2529

30+
# Show usage
31+
usage() {
32+
echo "============================================="
33+
echo " CodeVerse Linux ISO Build Script"
34+
echo "============================================="
35+
echo
36+
echo "Description: Builds a bootable live ISO of CodeVerse Linux."
37+
echo
38+
echo "Usage: ./$(basename "$0") [OPTIONS]"
39+
echo
40+
echo "Options:"
41+
echo " -h, --help Show this help message and exit"
42+
echo " -c, --clean Clean build directory before building"
43+
echo " -p, --packages Only build custom packages, skip ISO creation"
44+
echo " -n, --no-pkg Skip building custom packages"
45+
echo
46+
echo "Environment variables:"
47+
echo " WORK_DIR Build work directory (default: \$PROJECT_ROOT/.build)"
48+
echo
49+
echo "Examples:"
50+
echo " ./$(basename "$0") # Standard build"
51+
echo " ./$(basename "$0") --clean # Clean previous builds and build"
52+
echo " ./$(basename "$0") --no-pkg # Build ISO without recompiling packages"
53+
echo
54+
}
55+
2656
# Check dependencies
2757
check_dependencies() {
2858
log_info "Checking dependencies..."
@@ -167,7 +197,7 @@ prepare_profile() {
167197
log_warn "Setup configs not found at $setup_src"
168198
fi
169199

170-
# Copy built packages (CVH + AUR) to ISO for offline installation
200+
# Copy built packages (CodeVerse Linux + AUR) to ISO for offline installation
171201
local repo_src="$PROJECT_ROOT/repo/x86_64"
172202
local repo_dest="$WORK_DIR/profile/airootfs/opt/cvh-repo"
173203

@@ -217,29 +247,13 @@ cleanup() {
217247
log_success "Cleanup complete"
218248
}
219249

220-
# Show usage
221-
usage() {
222-
echo "CVH Linux ISO Build Script"
223-
echo
224-
echo "Usage: $0 [OPTIONS]"
225-
echo
226-
echo "Options:"
227-
echo " -h, --help Show this help message"
228-
echo " -c, --clean Clean build directory before building"
229-
echo " -p, --packages Only build custom packages"
230-
echo " -n, --no-pkg Skip building custom packages"
231-
echo
232-
echo "Environment variables:"
233-
echo " WORK_DIR Build work directory (default: \$PROJECT_ROOT/.build)"
234-
echo
235-
}
236-
237250
# Main
238251
main() {
239252
local clean=false
240253
local packages_only=false
241254
local skip_packages=false
242255

256+
# Parse arguments
243257
while [[ $# -gt 0 ]]; do
244258
case $1 in
245259
-h|--help)
@@ -260,15 +274,15 @@ main() {
260274
;;
261275
*)
262276
log_error "Unknown option: $1"
263-
usage
277+
echo "Run '$0 --help' for usage information."
264278
exit 1
265279
;;
266280
esac
267281
done
268282

269283
echo
270284
echo "╔════════════════════════════════════════════╗"
271-
echo " CVH Linux ISO Build Script "
285+
echo "CodeVerse Linux ISO Build Script ║"
272286
echo "╚════════════════════════════════════════════╝"
273287
echo
274288

@@ -296,8 +310,9 @@ main() {
296310
log_success "Build complete!"
297311
echo
298312
echo "To test the ISO with QEMU:"
299-
echo " qemu-system-x86_64 -enable-kvm -m 4G -cdrom $OUT_DIR/cvh-linux-*.iso"
313+
echo " qemu-system-x86_64 -enable-kvm -m 4G -cdrom $OUT_DIR/codeverse-linux-*.iso"
300314
echo
301315
}
302316

303-
main "$@"
317+
# Call main with all arguments
318+
main "$@"

scripts/build-packages.sh

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
2-
# Build custom CVH Linux packages
3-
# Creates cvh-fuzzy, cvh-icons, and cvh-branding packages
2+
# Build custom CodeVerse Linux packages
3+
# Creates codeverse-fuzzy, codeverse-icons, and codeverse-branding packages
4+
#
5+
# USAGE: ./build-packages.sh [OPTIONS]
6+
#
7+
# Run './build-packages.sh --help' for more detailed information.
48

59
set -euo pipefail
610

@@ -23,6 +27,25 @@ log_success() { echo -e "${GREEN}[OK]${NC} $1"; }
2327
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
2428
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
2529

30+
# Show usage
31+
usage() {
32+
echo "============================================="
33+
echo " CodeVerse Linux Package Build Script"
34+
echo "============================================="
35+
echo
36+
echo "Description: Builds custom packages (fuzzy, icons, branding)"
37+
echo " and AUR dependencies for CodeVerse Linux."
38+
echo
39+
echo "Usage: ./$(basename "$0") [OPTIONS]"
40+
echo
41+
echo "Options:"
42+
echo " -h, --help Show this help message and exit"
43+
echo
44+
echo "Examples:"
45+
echo " ./$(basename "$0") # Build all required packages"
46+
echo
47+
}
48+
2649
# Check for Rust
2750
check_rust() {
2851
if ! command -v cargo &> /dev/null; then
@@ -163,11 +186,11 @@ create_fuzzy_pkgbuild() {
163186

164187
# Use absolute path in PKGBUILD
165188
cat > "$PKGBUILD_DIR/cvh-fuzzy/PKGBUILD" <<EOF
166-
# Maintainer: CVH Linux Team
189+
# Maintainer: CodeVerse Linux Team
167190
pkgname=cvh-fuzzy
168191
pkgver=0.1.0
169192
pkgrel=1
170-
pkgdesc="Universal fuzzy finder for CVH Linux"
193+
pkgdesc="Universal fuzzy finder for CodeVerse Linux"
171194
arch=('x86_64')
172195
url="https://github.com/codeversehub/cvh-linux"
173196
license=('GPL3')
@@ -188,7 +211,7 @@ package() {
188211
189212
# Install shell integration
190213
install -Dm644 /dev/stdin "\$pkgdir/usr/share/cvh-fuzzy/shell/zsh.zsh" <<'ZSHEOF'
191-
# CVH Fuzzy Zsh Integration
214+
# CodeVerse Linux Fuzzy Zsh Integration
192215
if command -v cvh-fuzzy &> /dev/null; then
193216
cvh-fuzzy-file-widget() {
194217
local selected=\$(cvh-fuzzy --mode files)
@@ -221,11 +244,11 @@ create_icons_pkgbuild() {
221244

222245
# Use absolute path in PKGBUILD
223246
cat > "$PKGBUILD_DIR/cvh-icons/PKGBUILD" <<EOF
224-
# Maintainer: CVH Linux Team
247+
# Maintainer: CodeVerse Linux Team
225248
pkgname=cvh-icons
226249
pkgver=0.1.0
227250
pkgrel=1
228-
pkgdesc="Sandboxed Lua-scriptable desktop icons for CVH Linux"
251+
pkgdesc="Sandboxed Lua-scriptable desktop icons for CodeVerse Linux"
229252
arch=('x86_64')
230253
url="https://github.com/codeversehub/cvh-linux"
231254
license=('GPL3')
@@ -250,7 +273,7 @@ package() {
250273
251274
# Install default config
252275
install -Dm644 /dev/stdin "\$pkgdir/etc/cvh-icons/config.toml" <<'CONFEOF'
253-
# CVH Icons Configuration
276+
# CodeVerse Linux Icons Configuration
254277
icon_size = 64
255278
grid_spacing = 20
256279
font_size = 12.0
@@ -278,11 +301,11 @@ create_branding_pkgbuild() {
278301
mkdir -p "$PKGBUILD_DIR/cvh-branding"
279302

280303
cat > "$PKGBUILD_DIR/cvh-branding/PKGBUILD" <<EOF
281-
# Maintainer: CVH Linux Team
304+
# Maintainer: CodeVerse Linux Team
282305
pkgname=cvh-branding
283306
pkgver=0.1.0
284307
pkgrel=1
285-
pkgdesc="CVH Linux branding, GRUB theme, and default configurations"
308+
pkgdesc="CodeVerse Linux branding, GRUB theme, and default configurations"
286309
arch=('any')
287310
url="https://github.com/codeversehub/cvh-linux"
288311
license=('GPL3')
@@ -294,7 +317,7 @@ _cvh_root="$PROJECT_ROOT"
294317
package() {
295318
# MOTD - welcome message
296319
install -Dm644 /dev/stdin "\$pkgdir/etc/motd" <<'MOTDEOF'
297-
Welcome to CVH Linux!
320+
Welcome to CodeVerse Linux!
298321
299322
Quick Start:
300323
- Mod+Return Open terminal
@@ -306,10 +329,10 @@ Quick Start:
306329
For more info: https://github.com/codeversehub/cvh-linux
307330
MOTDEOF
308331
309-
# CVH Linux info file
332+
# CodeVerse Linux info file
310333
install -Dm644 /dev/stdin "\$pkgdir/usr/share/cvh-linux/info" <<'INFOEOF'
311-
NAME="CVH Linux"
312-
PRETTY_NAME="CVH Linux"
334+
NAME="CodeVerse Linux"
335+
PRETTY_NAME="CodeVerse Linux"
313336
ID=cvh
314337
VERSION_ID=0.1
315338
HOME_URL="https://codeversehub.dev"
@@ -464,9 +487,24 @@ update_repo_db() {
464487

465488
# Main
466489
main() {
490+
# Parse arguments
491+
while [[ $# -gt 0 ]]; do
492+
case $1 in
493+
-h|--help)
494+
usage
495+
exit 0
496+
;;
497+
*)
498+
log_error "Unknown option: $1"
499+
echo "Run '$0 --help' for usage information."
500+
exit 1
501+
;;
502+
esac
503+
done
504+
467505
echo
468506
echo "╔════════════════════════════════════════════╗"
469-
echo " CVH Linux Package Build Script "
507+
echo "CodeVerse Linux Package Build Script ║"
470508
echo "╚════════════════════════════════════════════╝"
471509
echo
472510

@@ -498,4 +536,5 @@ main() {
498536
echo
499537
}
500538

501-
main "$@"
539+
# Call main with all arguments
540+
main "$@"

0 commit comments

Comments
 (0)